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

Open Listbox on pressing Enter #935

Open
danielsimao opened this issue Jun 21, 2022 · 2 comments
Open

Open Listbox on pressing Enter #935

danielsimao opened this issue Jun 21, 2022 · 2 comments

Comments

@danielsimao
Copy link
Contributor

🚀 Feature request

Current Behavior

At the moment, while the focus is in ListboxButton, you can only open the Listbox by pressing Space and some of the ArrowKeys.

Desired Behavior

Add the possibility of opening the listbox by pressing Enter while the focus is in the ListboxButton.

Suggested Solution

For what I gathered, should require only a check for the key pressed on KeyDown and emit open listbox event in case that key equals Enter.

Who does this impact? Who is this for?

Intermediet

@danielsimao
Copy link
Contributor Author

danielsimao commented Jun 21, 2022

I see machine.ts is handling the onEnter event in a different way, but I dunno if I agree. Allowing the listbox button to submit the form should come in come in some kind of prop that would enable that. Not opening the listbox while pressing Enter as been very weird as user and that key is always my go to, even more than the Space key.

@carlostpg
Copy link

carlostpg commented Aug 30, 2023

FWIW the ARIA Authoring Practices for a "Select-Only Combobox" (not to be confused with reach-ui/Combobox, which allows for user text input) notes that Enter key "Opens the listbox without moving focus or changing selection" when closed. It would be great for reach-ui to match that recommendation too.

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

2 participants