Web Accessibility & WCAG (50 Qs)•Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)
The Combobox Pattern: Accessible Typeahead Autocomplete (`aria-activedescendant`).
senior LevelSystem Design
In Simple Words: When a user types in a search box and suggestions appear below:
- Instead of moving true focus away from the input to the dropdown items (which would stop the user from typing!), keep focus inside
<input>. - Set
role="combobox",aria-autocomplete="list",aria-expanded="true". - As the user presses Down Arrow, update
aria-activedescendant="suggestion-opt-3". - Screen readers announce the highlighted suggestion while the input cursor remains active!