Eui: [EuiSelectable] Behavior of using Home and End key in searchbar

Created on 19 Feb 2021  路  4Comments  路  Source: elastic/eui

Hey,

In EuiSelectable (and EuiSelectableTemplateSitewide by extension), the Home and End key is currently configured to move around the options, as seen in the following snippet:

https://github.com/elastic/eui/blob/db3ddc19bf7b4a7d1c7b213d4c97ed32f38b6e7c/src/components/selectable/selectable.tsx#L272-L285

I've received feedback from my users that they expected the Home and End key to behave differently.

In the scenario they encountered, they typed a search term and found no results. Realizing their mistake, they tried using the Home or End key to move around the text and make adjustments to their search term. In this scenario, it does nothing because there were no results shown and it leaves them confused.

I'm sure the eui team has your own considerations for the alternate behavior, but seeing that the team plans to use EuiSelectable in more components (#4054), can I suggest an option for outside consumers to opt out of this behavior?

Please let me know if this is not something the team is keen on

accessibility bug good first issue

All 4 comments

馃 Thanks for bringing this to our attention!

So the reason we do this is because it is recommended by the ARIA practices spec but it looks like in the latest version it tweaks it slightly to only recommend the custom behavior if the text isn't editable.

Though I guess you could build a non-editable combobox with our base components, I don't think that's a specific use case for us so maybe we just get rid of this all together.

This makes sense to me, especially as we keep the text cursor in the input even when the options list is "active".

working on it

That was quick!

Thanks @myasonik for linking both ARIA specs, I had no idea they included comboboxes 馃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

peteharverson picture peteharverson  路  4Comments

peteharverson picture peteharverson  路  3Comments

johnbarrierwilson picture johnbarrierwilson  路  3Comments

cedeber picture cedeber  路  4Comments

roberto910907 picture roberto910907  路  3Comments