floatype.js icon indicating copy to clipboard operation
floatype.js copied to clipboard

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

Open Sudharshaun opened this issue 1 year ago • 4 comments

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.

https://github.com/user-attachments/assets/bb1b9019-b311-424b-9523-1ed1e1ff2917

Sudharshaun avatar Sep 13 '24 16:09 Sudharshaun

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

RohitKumarGit avatar Sep 24 '24 06:09 RohitKumarGit

yes, that is my point here as well.

Sudharshaun avatar Sep 24 '24 16:09 Sudharshaun

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?

knadh avatar Sep 24 '24 17:09 knadh

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 

RohitKumarGit avatar Sep 24 '24 18:09 RohitKumarGit