How can I make an autocomplete field usable with a keyboard?
Quick answer
Define separate behavior for the text in the input, whether suggestions are open, and which suggestion is active or selected. Let keyboard users reach and move through suggestions, accept one, dismiss the popup, or return to typing without losing their current text. Write down the expected result of each key and test it in the actual interface. The WAI-ARIA APG describes common combobox patterns, but does not establish that every product behaves identically. [S1]
The question, the details, the next step.
A practical checklist
Document whether the field uses manual selection, automatic selection, or inline completion.
Keep input value, popup visibility, and active or selected option distinct.
Specify what Down Arrow, Up Arrow, Enter, Escape, and printable characters do.
Write expected results for moving, accepting, dismissing, and continuing to type.
Test with no suggestions and with no active suggestion.
A few more useful answers
Does moving to a suggestion mean it has been accepted?
Not necessarily. Distinguish the active option from the value committed to the input, and define the acceptance action.
Should Escape clear what the person typed?
The APG pattern describes Escape as dismissing the popup and returning to the input without necessarily changing its prior value. Specify and test the field’s exact behavior. [S1]
Does this guidance prove my autocomplete is accessible?
No. It describes interaction patterns, not a test result or guarantee for your implementation. Test the field and document its behavior in relevant states. [S1]
Sources
References used for this guide.
- [S1] WAI-ARIA Authoring Practices Guide: Combobox Pattern w3.org · Checked
