This page simulates three possible keyboard/focus models for filterable select using plain HTML, ARIA and JS, so they can be compared in any browser and with assistive technology. It is not the native feature. See also w3c/aria#2841.
Legend:
virtual focus (:active-option / aria-activedescendant)
real DOM focus (:focus-visible)
✓ = selected
| Key | Option 1: active-option + focusable options | Option 2: active-option only | Option 3: real focus moves to options |
|---|---|---|---|
| Typing in text field | Filters options. Clears any active option. | ||
| ArrowDown in text field | Moves the active option (focus stays in text field) | Moves DOM focus to the first visible option | |
| ArrowUp in text field | Moves active option up; from the first option, clears it (back to "text editing") | Default text field behavior | |
| Enter in text field | Selects/toggles the active option | Nothing | |
| Left/Right/Home/End/Escape in text field | Clears the active option (and Left/Right/Home/End do their normal caret movement) | Default text field behavior | |
| Tab from text field | Focuses an option in the listbox | Leaves the widget | Focuses an option in the listbox |
| Arrows in listbox | Move DOM focus between options; ArrowUp on first option returns to text field | n/a (listbox not focusable) | Move DOM focus between options; ArrowUp on first option returns to text field |
| Leaving the text field (Tab, click elsewhere) | Clears the active option | n/a | |
| Space / Enter in listbox | Select/toggle focused option | n/a | Select/toggle focused option |
| Printable characters in listbox | Typeahead | n/a | Configurable: typeahead, or redirect to text field |
| Clicking an option | Selects/toggles; focus moves to option | Selects/toggles; focus stays in text field | Selects/toggles; focus moves to option |
Only works in Chromium with chrome://flags/#enable-experimental-web-platform-features.
The prototype implements Option 1. In other browsers this renders as an unrelated text field and listbox.