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

Combobox does not automatically select on blur when there is only 1 option #3521

Open
jimmyzzxhlh opened this issue Oct 11, 2024 · 0 comments

Comments

@jimmyzzxhlh
Copy link

jimmyzzxhlh commented Oct 11, 2024

What package within Headless UI are you using?

@headlessui/react

What version of that package are you using?

2.1.6

What browser are you using?

Chrome (MAC)

Reproduction URL

Can be reproduced on the documentation page: https://headlessui.com/react/combobox

Describe your issue

If there is only 1 option available in the Combobox, and user clicks outside of the combobox, I would expect that option to be selected, but it's not. It is only selected if the user hits tab key, which is an inconsistent behavior, as in both cases the focus is moved outside of the Combobox.

Specifically, this behavior can be frustrating when the user clicks on the combobox, pastes some text that leads to the combobox showing only 1 option (to make it worse, the option may be highlighted which indicates that it is automatically selected), and then clicks outside of the combobox.

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

1 participant