Accessibility
a11y/combobox-on-input
role="combobox" sits on the input itself (ARIA 1.2), not on a wrapper element that contains the input.
seriousstaticWCAG 4.1.2 · Afe-a11y-combobox
Why
The wrapper shape comes from older ARIA versions. Current screen readers expect the focused input to be the combobox; with the role on a div they announce a plain edit field and never say that suggestions exist or which one is highlighted.
Fix
Put role="combobox", aria-expanded, aria-controls (the listbox id) and aria-autocomplete on the <input>, keep its <label>, and drop the wrapper's role and aria-owns. A select-only combobox (no typing) puts the role on a focusable div or button and has no input.
Examples
<!-- bad -->
<div role="combobox" aria-expanded="false"><input type="text"></div>
<!-- good -->
<input type="text" role="combobox" aria-expanded="false" aria-controls="list" aria-autocomplete="list">Sources
Facts
- Id
a11y/combobox-on-input- Severity
- serious
- Check
- static checked in the source by
audit - Applies to
htmlangularvuesvelteastrojsx- WCAG 2.2
- 4.1.2, level A
- Same problem in
- axe-core
aria-required-children - Taught by the skill
fe-a11y-comboboxCombobox, listbox and custom select- Since version
- 0.1.0
Read it in the terminal
npx github:dawidolko/frontend-skills explain a11y/combobox-on-input