Accessible Combobox and Autocomplete: WAI-ARIA 1.2 Design Pattern Implementation

Comboboxes and autocompletes are among the most difficult UI components to make accessible. Master WAI-ARIA 1.2 keyboard interactions, active descendant focus, and mobile touch support.

Comboboxes and autocomplete inputs - components that combine a single-line textbox with an expandable popup listbox - are among the most common and frequently broken UI components on the modern web. In the W3C WAI-ARIA 1.2 and 1.3 specifications, the combobox pattern was thoroughly overhauled to provide a unified, predictable model across desktop screen readers and mobile devices.

Key WAI-ARIA 1.2 Architecture Rule

In WAI-ARIA 1.2, the <input> element itself receives role="combobox", aria-expanded="true|false", aria-haspopup="listbox", and aria-controls="popup-id". The popup listbox is a sibling or child element with role="listbox".

Anatomy of the WAI-ARIA 1.2 Combobox Specification

An accessible combobox requires four core structural elements working in coordination:

  • The Input Container: An <input type="text"> element with role="combobox".
  • The Popup List: A container with role="listbox" and a unique id referenced by the combobox's aria-controls.
  • The List Items: Child elements with role="option", unique IDs, and aria-selected="true|false".
  • The Status Announcement: An aria-live="polite" region announcing the count of filtered suggestions (e.g. "5 suggestions available").

Mandatory Keyboard Navigation and Focus Management

Key / Shortcut Focus Location Required Interaction
Down Arrow Inside text input Opens popup if closed; moves active highlight to the next available option
Up Arrow Inside text input Moves active highlight to the previous available option; returns to input at top
Enter Inside text input Selects the actively highlighted option, closes popup, updates input value
Escape Inside text input Closes popup without changing input value; clears highlight
Tab Inside text input Closes popup; moves DOM focus to the next interactive page element

aria-activedescendant vs DOM Focus in Dynamic Dropdowns

The most robust method for managing keyboard focus in a combobox is virtual focus via aria-activedescendant. The DOM focus remains continuously on the <input> element so the user can keep typing, while the aria-activedescendant attribute dynamically updates to the id of the currently highlighted role="option":

<label for="country-input" id="country-label">Select Country</label>
<div class="combobox-wrapper">
  <input
    id="country-input"
    type="text"
    role="combobox"
    aria-expanded="true"
    aria-autocomplete="list"
    aria-haspopup="listbox"
    aria-controls="country-listbox"
    aria-labelledby="country-label"
    aria-activedescendant="opt-canada"
    autocomplete="off">
  <ul id="country-listbox" role="listbox" aria-labelledby="country-label">
    <li id="opt-brazil" role="option" aria-selected="false">Brazil</li>
    <li id="opt-canada" role="option" class="highlighted" aria-selected="true">Canada</li>
    <li id="opt-denmark" role="option" aria-selected="false">Denmark</li>
  </ul>
</div>

Multi-Select Token and Tag Removal Accessibility

In multi-select comboboxes (tag pickers), selected tokens rendered before the text input must feature accessible removal buttons with descriptive labels (e.g. aria-label="Remove Canada tag"). Pressing Backspace on an empty input should select or remove the preceding token with immediate polite screen reader confirmation.

Production-Ready Vanilla and React Combobox Implementation

Rogabot automatically checks every combobox and autocomplete component on your domain for missing aria-controls, broken aria-activedescendant pointers, and missing keyboard listeners, delivering ready-to-merge developer fixes to protect your site from ADA litigation.

Audit Your Website for WCAG 2.2 Compliance Today

Scan your domain in 60 seconds with Rogabot and get instant PR-ready code diffs to prevent ADA lawsuit exposure.

View Pricing Plans