If youâve ever run an accessibility audit and seen an error like: âšâARIA hidden element must not be focusable or contain focusable elements,â âšyouâre seeing one of the most commonâand confusingâdigital 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âto act as if it doesnât exist in the accessibility tree.
This can sometimes be useful for things like inactive UI components. But it also comes with responsibility: âšIf something âdoesnât existâ to assistive technology, users shouldnât 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âs what can happen:
- A user can tab into the hidden element.
- Their screen reader says nothing, because the element is hidden.
- They donât 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ât 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.
¶ÙŽÇČÔât:Ìę
- 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
- ±őŽÚÌęŸ±łÙâsÌęaria-hidden, it should be non-interactive.
- If itâs interactive, it should not be aria-hidden.
Please note that in the guidance from the WC3, the organization that wrote the ARIA specifications. the âFirst Rule of ARIAâ is that you should use HTMLâand not use ARIAâwhenever possible.
Learn More
For more guidance on using ARIA correctly, check out the ÁńÁ«ÊÓÆ”âs accessibility checklist on ARIA â Accessible Technology. Itâs 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: