Many users of TypeaheadSearch are expecting keyboard behaviors that Codex does not currently implement. These behaviors include:
- Allowing Home and End keys to move the cursor to the start or end of the text input, respectively
- Allowing Shift+Home and Shift+End to select from the current cursor location to the start or end of the text input
- Anything else?
Initial bug report
(from @Jack_who_built_the_house )
If I type text in the new search bar and want to move the caret to the beginning of it, I can't do it by pressing Home. Instead, the first item in the suggestion list gets selected:
The same is true for the End key. (Page Down and Page Up don't move the selection.)
If, by any chance, that was done deliberately, I find that extremely intrusive, annoying, and contradicting the principle of least astonishment.
Technical Considerations
TypeaheadSearch delegates most keyboard interactions to its embedded Menu component. The latter component was designed to handle Home and End keypress events in its own way – by moving the menu selection to the first or last item. However, this interaction may not be appropriate for components that include both a Menu as well as a TextInput. This includes TypeaheadSearch but also Lookup and Combobox. It is pretty straightforward to change these components so that they stop delegating Home/End keypress events to the Menu component without changing the latter.
The TextInput component itself may or may not need to change – we should do some cross-browser and cross-OS testing to make sure the component is handling keyboard interactions in the expected way.