role='combobox' and aria-expanded on the container. role='textbox', aria-autocomplete='list', aria-controls, aria-activedescendant on the input. role='option' and aria-selected on each suggestion. Update aria-expanded and aria-activedescendant via JavaScript.
What ARIA attributes does an autocomplete need?
More FAQs in Autocomplete Search Bar: Complete Interview Checklist
Core (input, debounce 300ms, fetch, render, select, click-outside), advanced (keyboard nav, highlight, loading, no-results, caching, AbortController), accessibility (ARIA combobox/option), CSS (absolute, hover, highlighted, scroll), and testing (typing, debounce, keys, enter, escape, click-outside, no results, empty).
Input with suggestions list, debounce (300ms), fetch/filter suggestions, render dropdown, click to select, and click outside to close. These are the minimum. Keyboard navigation and highlighting are strong bonuses.
Keyboard navigation (arrow keys, enter, escape), highlight matching text, loading state, no results state, caching (Map), and AbortController for cancelling previous requests. These show depth and production-readiness.
Still have questions?
Browse all our FAQs or reach out to our support team
Want to upskill yourself?
Your learning library
Small steps. Big possibilities.
Find your next course. Build something great.