← Hub · Open the note

Combobox (autocomplete suggestions) — demo — BEFORE/AFTER

Goal: show suggestions without stealing focus, and keep keyboard + screen reader behavior predictable.

BEFOREFake suggestions (focus jumps to list items)

Problems: no roles, no active option semantics, and the Arrow keys can move focus away from the input (confusing for screen readers).

Try: type san, then press . Focus jumps into the list, so you’re no longer editing the field.

AFTERAccessible combobox (focus stays in input)

Pattern: keep focus in the input; use role="combobox" + popup role="listbox", and track the highlighted option with aria-activedescendant.

Keyboard: type to filter · / moves · Enter selects · Esc closes.

Quick checklist