On this page

Combobox

Keys, what Combobox gives you and what your team does.

Conformance

Combobox meets WCAG 2.2 level AA when used as described on these pages. It follows the Combobox pattern with list autocomplete of the WAI-ARIA Authoring Practices.

Keyboard

Key Action
Tab Moves focus to the field.
Typing Opens the list and filters it.
↓ ↑ Open the list, then move through the options. Focus stays in the field.
Enter Chooses the highlighted option and closes the list.
Esc Closes the list.

What Combobox gives you

  • role="combobox" on the field with aria-autocomplete="list", aria-expanded and aria-controls; role="listbox" on the list and role="option" with aria-selected on each option.
  • The highlighted option is announced while focus stays in the field (aria-activedescendant).
  • The text-field focus on the search field: the edge turns color.border.focus with a 2 px inset ring of the same colour.
  • Chosen options are marked by a check mark as well as their fill.

What your team does

  • Name the field with a <label for> on its id. A search field inside the list needs aria-label.
  • Name a button trigger with its label and value, such as aria-labelledby="store-label store-picker".
  • Keep the “no results” text so people know the search ran.
  • Announce server results: when the list comes from a server, say how many options were found in a polite live region.

WCAG criteria

Criterion Level How
1.3.1 Info and Relationships A Label linked with for; groups have headings
2.1.1 Keyboard A Every action has a key
2.4.7 Focus Visible AA Text-field focus; highlighted option fill
4.1.2 Name, Role, Value A combobox, listbox, option, aria-selected
4.1.3 Status Messages AA The “no results” text; your live region for server results