If聽you鈥檝e聽ever run an聽accessibility audit聽and seen an error like:聽鈥ㄢARIA hidden聽element聽must not be focusable or聽contain聽focusable elements,鈥澛犫▂ou鈥檙e seeing one of the most common鈥攁nd confusing鈥攄igital accessibility issues.
What ARIA Does
ARIA, or Accessible Rich Internet Applications, is a set of HTML attributes that help assistive technologies (like screen readers) interpret complex or custom user interfaces. One of these attributes, aria-hidden=”true”, tells assistive technology to ignore an element鈥攖o act as if it doesn鈥檛 exist in the accessibility tree.
This can sometimes be useful for things like inactive UI components. But it also comes with responsibility: 鈥↖f something 鈥渄oesn鈥檛 exist鈥 to assistive technology, users shouldn鈥檛 be able to tab into it.
Why This Error Matters
When a developer marks something as aria-hidden=”true” but leaves it focusable 鈥 say, a button, link, or input 鈥 it creates a trap for people who navigate by keyboard or screen reader.
Here鈥檚聽what can happen:
- A user can tab into the hidden element.
- Their screen reader says nothing, because the element is hidden.
- They don鈥檛 know where they are or how to move forward.
- Navigation becomes confusing or even impossible.
Essentially, the聽user has reached a dead end.
Easy Rules to Follow
To avoid creating these barriers, follow these simple guidelines:
顿辞:听
- Use HTML hidden or inert attributes, instead of ARIA, for elements that shouldn鈥檛 be interacted with.
- Instead of hiding or disabling elements, leave them active and offer clear labels and error messages to help users avoid errors and understand what needs to be fixed when they make them
- Ensure that anything that must be visually hidden is also removed from keyboard focus.
顿辞苍鈥檛:听
- Put buttons, links, or inputs inside an element with aria-hidden=”true”.
- Rely on aria-hidden alone to disable content.
- Leave off-screen menus or modals tabbable when closed
A Simple Mental Model
- 滨蹿听颈迟鈥檚听aria-hidden, it should be聽non-interactive.
- If it鈥檚 interactive, it should not be aria-hidden.
Please note that in the guidance from the WC3, the organization that wrote the ARIA specifications. the 鈥淔irst Rule of ARIA鈥 is that you should use HTML鈥攁nd not use ARIA鈥攚henever possible.
Learn More
For more guidance on using ARIA correctly, check out the 糖心少女鈥檚 accessibility checklist on聽ARIA 鈥 Accessible Technology.聽It鈥檚聽a great resource for understanding when (and when not) to use ARIA attributes and how to keep your web content accessible for everyone.
Additional Posts in the Web Accessibility Series: