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

Pressing space selects the suggesition from the dropdown instead of destroying it. #8

Open
Sudharshaun opened this issue Sep 13, 2024 · 4 comments

Comments

@Sudharshaun
Copy link

After typing a word if the user presses spacebar, the first option in the dropdown gets selected. As I was using the textArea I found it annoying and I had to go back and delete the previous word.

The user intention of pressing the spacebar would be after completing the word and has neglected the current suggestions from dorpdown.

floattype_spacebar_issue.mp4
@RohitKumarGit
Copy link

@Sudharshaun w3c standard suggests that tab must be used for choice and not space

@Sudharshaun
Copy link
Author

yes, that is my point here as well.

@knadh
Copy link
Owner

knadh commented Sep 24, 2024

hm, in my experience, floating search suggestions in large textareas generally use space for selection (for speed). I can think of https://www.google.co.in/inputtools/try/ as an example.

Narrow input auto-suggestions generally neither react to space nor tab, but rely on an up/down selection, for example, Google search suggestions.

w3c standard suggests that tab must be used for choice and not space

@RohitKumarGit can you provide a link for this?

@RohitKumarGit
Copy link

RohitKumarGit commented Sep 24, 2024

Hi @knadh
according to this ( semantically we should follow this standard as ours is also a selectbox with dynamic positioning )
https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/

my personal thinking is , that with space is good when you have only 1 option and you have nothing to choose ( like Gmail ).. like a suggestion and not a choice.

See the "Listbox Popup" section , there they have mentioned. :

Space => Opens the listbox without moving focus or changing selection.

and

Tab

  1. Sets the value to the content of the focused option in the listbox.
  2. Closes the listbox.
  3. Performs the default action, moving focus to the next focusable element. Note: the native  element closes the listbox but does not move focus on tab. This pattern matches the behavior of the other comboboxes rather than the native element in this case.

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