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 doesn't close when using Tab to unfocus a select. #291

Closed
rid9 opened this issue Dec 17, 2023 · 6 comments
Closed

Dropdown doesn't close when using Tab to unfocus a select. #291

rid9 opened this issue Dec 17, 2023 · 6 comments

Comments

@rid9
Copy link

rid9 commented Dec 17, 2023

To reproduce:

  1. Visit the examples page in the documentation.
  2. Click on the first select to open its dropdown.
  3. Press Tab.

This will focus the next element on the page without closing the dropdown. If you press Tab a few more times, you will be able to focus the next select, and pressing Enter will open that select's dropdown. Now you'll have two dropdowns visible on the page at the same time.

The dropdown should be closed whenever the select loses focus, whether that happens as a result of a mouse event or a keyboard event. Right now, this only happens for mouse events.

@abenhamdine
Copy link
Contributor

Actually I can reproduce this behaviour only for the first select in the demo, without searchbox.
If you unfocus with Tab in the following examples, with searchbox, it works

@rid9
Copy link
Author

rid9 commented Dec 20, 2023

Actually I can reproduce this behaviour only for the first select in the demo, without searchbox. If you unfocus with Tab in the following examples, with searchbox, it works

Indeed, if you open a select with search, pressing Tab will close the dropdown as expected. This only happens if the search bar is enabled though.

For example, if you go to the Multiple select without search example, you can Tab to the next two examples and open a total of three dropdowns at the same time. Also, if you press Tab on the select with search and arrive at the next select, which doesn't have search enabled, you can still open it, and now you have four dropdowns open at the same time.

@gnbm
Copy link
Collaborator

gnbm commented Dec 22, 2023

@joserio Does your PR fixes this as well?

@gnbm
Copy link
Collaborator

gnbm commented Jan 2, 2024

@rid9 / @abenhamdine could you please check if this was properly fixed in release v1.0.41

@gnbm
Copy link
Collaborator

gnbm commented Jan 2, 2024

Fixed in release v1.0.41

@gnbm gnbm closed this as completed Jan 2, 2024
@rid9
Copy link
Author

rid9 commented Jan 3, 2024

@gnbm, v1.0.41 did fix the issue, thank you, but it's a bit inconsistent.

The dropdown does close when you use Tab, but only if you have a search box or multiple select. If you have none of these, then it doesn't close, but the focus is trapped inside the dropdown, so that works as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants