Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tabview: Space key is not working inside TabPanel header template. #15394

Closed
lcotfas opened this issue Apr 29, 2024 · 4 comments
Closed

Tabview: Space key is not working inside TabPanel header template. #15394

lcotfas opened this issue Apr 29, 2024 · 4 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@lcotfas
Copy link

lcotfas commented Apr 29, 2024

Describe the bug

I've added an input component in tab panel header template.

I've noticed that "space" key is not working when I try to write something inside the input component.

Environment

https://stackblitz.com/edit/njuv7d-6gn33a?file=src%2Fapp%2Fdemo%2Ftab-view-template-demo.html

Reproducer

https://stackblitz.com/edit/njuv7d-6gn33a?file=src%2Fapp%2Fdemo%2Ftab-view-template-demo.html

Angular version

17.3.1

PrimeNG version

17.15.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

20.10.0

Browser(s)

Chrome 124.0.6367.91

Steps to reproduce the behavior

1.Create a Tabview component.
2.Add one or more tab panels
3.Add header template inside p-tabPanel
<ng-template pTemplate="header"> <i class="pi pi-calendar"></i> <span>Header I</span> <input placeholder="'test'"> </ng-template>
4.Try to type something inside input and add a couple of spaces

Expected behavior

The expected behavior is to be able to write something with spaces like: "This is a test and spaces are working"

@lcotfas lcotfas added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 29, 2024
@mjlux
Copy link

mjlux commented May 5, 2024

We have encountered a similiar issue in the OrderList component with a nested Panel Component.
To solve it we added the following keyboard event Listener to the input:
(keydown.space)="$event.stopPropagation()"
This will stop the eventListener of the primeng component from triggering.
In the OrderList it was selecting/deselecting the current item instead of inserting spaces into the input fields.

@lcotfas
Copy link
Author

lcotfas commented May 6, 2024

We have encountered a similiar issue in the OrderList component with a nested Panel Component. To solve it we added the following keyboard event Listener to the input: (keydown.space)="$event.stopPropagation()" This will stop the eventListener of the primeng component from triggering. In the OrderList it was selecting/deselecting the current item instead of inserting spaces into the input fields.

Yes. I actually did that after I was looking in lib component and noticed that they have different actions on "Space" , "Enter" and so on.

@AlphaHydrae
Copy link

Also happens to me with OrderList in version 17.17.0. (keydown.space)="$event.stopPropagation()" indeed solves the issue.

Seems related to #14531 and #14377. The fix mentioned in the second issue also works, i.e. replacing the onSpaceKey method of the component which swallows the space key: https://github.com/primefaces/primeng/blob/17.17.0/src/app/components/orderlist/orderlist.ts#L811-L812

@mertsincan
Copy link
Member

Hi,

So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you open a new issue so we can include it in our roadmap?

Thanks a lot for your understanding!
Best Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

4 participants