=== Background
Currently, Menus support the up and down arrow keys, Selecting with {key Ctrl}+{key Space} is also possible.
(Menu is part of TypeaheadSearch component as one of the first Codex components going into public.)
=== Goal
In order to follow [[ https://www.w3.org/WAI/ARIA/apg/patterns/listbox/ | ARIA best practice ]] on `role="listbox"`, we should also consider supporting:
- {key Home}/{key End}, for navigating to the first/last item
- Allow the user to type characters and jump to the first item whose label/value matches those characters
=== Design spec
[[ https://www.figma.com/file/KoDuJMadWBXtsOtzGS4134/%E2%9D%96-Codex-components?node-id=4918%3A49426 | Keyboard navigation table in this Figma spec sheet. ]]
=== Acceptance criteria (or Done)
(more details in [[ https://phabricator.wikimedia.org/T310556#:~:text=SimoneThisDot-,added%20a%20comment.,-Thu%2C%20Jul%207 | this comment ]])
[] {key Home}/{key End}, for navigating to the first/last item
[] Allow the user to type characters and jump to the first item whose label/value matches those characters (this just needs to be implemented in the select component. Other components already have this feature)
[] Change behavior to "open" and "close" the menu when clicking the {key Space} button but without selecting the currently highlighted item
[] Add the ability to select an item by clicking {key Ctrl}+{key Space}
[] Change the current functionality to make sure we do NOT loop around when clicking {key up} at beginning or {key down} at end of options