MiHCM
primitives/@mihcm/ui·v0.21.0·stable

Combobox

Autocomplete search input combining a text field with a filterable dropdown list. Ideal for large option sets.

Combobox -- Accessibility

Keyboard

KeyAction
Enter / SpaceOpens the dropdown when the trigger is focused.
ArrowDownMoves highlight to the next option. Opens the dropdown if closed.
ArrowUpMoves highlight to the previous option.
EnterSelects the currently highlighted option and closes the dropdown.
EscapeCloses the dropdown without changing the selection.
HomeMoves highlight to the first option.
EndMoves highlight to the last option.
Printable charactersFilters the options list by typing into the search input.

When the dropdown is closed, focus remains on the trigger so the user can tab to the next form control normally.

ARIA roles

ElementAttributeValue
Triggerrolecombobox
Triggeraria-expandedtrue when dropdown is open, false otherwise
Triggeraria-haspopuplistbox
Triggeraria-controlsID of the listbox element
Triggeraria-activedescendantID of the currently highlighted option
Dropdownrolelistbox
Optionroleoption
Optionaria-selectedtrue on the selected option
Search inputaria-autocompletelist

Screen reader announcements

  • When the dropdown opens, screen readers announce the number of available options.
  • As the user types, the filtered count is announced via a live region (e.g. "3 results available").
  • When an option is highlighted with arrow keys, its label is announced.
  • On selection, the selected value is announced and the dropdown closes.
  • When no options match the search, an "No results found" message is announced.

Reduced motion

When prefers-reduced-motion: reduce is active:

  • The dropdown open/close animation is replaced with a simple show/hide.
  • Scroll-into-view for the highlighted option uses instant scrolling instead of smooth scrolling.

Native (React Native)

  • Uses Modal with FlatList for the dropdown.
  • TextInput for search filtering.
  • accessibilityRole="combobox" on the trigger.
  • Options use accessibilityRole="menuitem" with accessibilityState={{ selected }}.
  • Android back button closes the dropdown via onRequestClose.

Best practices

  • Always provide a meaningful placeholder.
  • Show an empty state message when no options match the search.
  • For very large lists (1000+), consider virtualised rendering.
  • Pair the combobox with a visible <label> in form contexts for proper screen reader association.
  • Avoid dynamically changing the options list while the dropdown is open, as this can disorient assistive technology users.