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

Dropdown: Tabbing away from dropdown sets selected item to first option #14307

Closed
erber014 opened this issue Dec 8, 2023 · 7 comments
Closed
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@erber014
Copy link

erber014 commented Dec 8, 2023

Describe the bug

When tabbing to/from a dropdown in https://primeng.org/dropdown the first option is selected. This is surely not how its meant to work? Navigating through a page using tab should not set values in inputs in my opinion

Environment

https://primeng.org/dropdown latest version 17.0.0

Reproducer

No response

Angular version

Whatever the official site uses

PrimeNG version

latest version 17.0.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

Whatever the official site uses

Browser(s)

Firefox

Steps to reproduce the behavior

Go to https://primeng.org/dropdown, tab through page from dropdown to dropdown. Watch as all dropdowns have the first option set as selected item.

Expected behavior

Tabbing through dropdown component should not set selected item.

@erber014 erber014 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Dec 8, 2023
@Orion151-C
Copy link

I think it's a normal behavior. Just try to tab to the select field, move using your arrow keys, and then click tab again. Your 'pre-selected' option, which was navigated using the arrows, will be taken as the selected option when you tab again.

If you dont use arrows, by default it will take the first option.

@Wykks
Copy link
Contributor

Wykks commented Dec 8, 2023

@erber014
Copy link
Author

erber014 commented Dec 8, 2023

I honestly dislike it, for an optional field that you don't want to fill in you would now need to manually clear the input every time you are navigating through the form. Maybe that's just me though... I also don't remember it working this way before, am I misremembering?

@Wykks
Copy link
Contributor

Wykks commented Dec 11, 2023

Oh wait a sec, I assumed that you were talking about the behavior when the dropdown is open.

Actually, it looks like a bug to me too, that the first value is selected when tabbing out without opening the dropdown.

@erber014
Copy link
Author

No, I was talking about behavior when dropdown is never open and you are only tabbing through the form. Was starting to think either I was crazy or the world is crazy, thanks. :)

@Da13Harris
Copy link

They've been doing lots of work on fixing dropdown issues lately, and I think this one may have been fixed already. They've got quite the backlog of issues, so if this one is fixed I recommend closing it.

@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 reopen the issue so we can include it in our roadmap?
Please don't forget to add your feedback as a comment after reopening the issue. These will be taken into account by us and will contribute to the development of this feature. 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

5 participants