Facebook Pixel

What ARIA attributes does an autocomplete need?

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.

Verify This Answer

Cross-check this information using these trusted sources:

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?

Our courses are taking a Coffee break, but your curiosity shouldn't. Stay engaged with namastedev linkedin, youtube, discord and other resources while you wait.

0
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.