On this page

Select

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

Conformance

Select meets WCAG 2.2 level AA when used as described on these pages. It follows the Select-only combobox pattern of the WAI-ARIA Authoring Practices.

Keyboard

Key Action
Tab Moves focus to the field.
Space, Enter, ↓ Opens the list on the chosen option.
↑ ↓ Move through the options. Disabled options are skipped.
Home End Go to the first or last option.
Letters Jump to the next option that starts with them.
Enter, Space Choose the option and close the list.
Esc Closes the list without changing the value. Focus returns to the field.

What Select gives you

  • role="combobox" on the field with aria-expanded and aria-controls; role="listbox" on the list and role="option" with aria-selected on each option.
  • Focus stays on the field while the list is open; the highlighted option is announced.
  • The text-field focus: the edge turns color.border.focus (8.0:1 on the page) with a 2 px inset ring of the same colour.
  • The chosen option is marked by a check mark as well as its fill, so colour is not the only cue.

What your team does

  • Name it. Put a <label for> on the field’s id, or aria-labelledby when the label is elsewhere.
  • Explain errors in text. With aria-invalid, show a message under the field and link it with aria-describedby.
  • Say why an option or the field is disabled, in the option text or in a hint under the field.

WCAG criteria

Criterion Level How
1.3.1 Info and Relationships A Label linked with for; groups have headings
1.4.11 Non-text Contrast AA Field edge color.border.bold and focus edge reach 3:1
2.1.1 Keyboard A Every action has a key
2.4.7 Focus Visible AA Text-field focus
3.3.1 Error Identification A aria-invalid plus an error message
4.1.2 Name, Role, Value A combobox, listbox, option, aria-selected