Accessibility algorithms will check that aria-hidden elements do not contain focusable elements.
The name and role of all user interface components must have the ability to be programmatically determined and notification of changes to these items must be available to user agents, including assistive technologies.
When the aria-hidden=”true” attribute is used on an element, it removes the element as well as all of its child nodes from the accessibility API. This means assistive technologies cannot access them.
The only time this attribute should be used is if hiding content will improve the user experience.
If aria-hidden needs to be used to hide visible content from screen readers, an identical or equivalent meaning and functionality must be accessible to assistive technologies.
Please note that using aria-hidden=”false” on content that is a descendent of an element that is hidden will not expose that content to the accessibility API.
When adding aria-hidden=”true” to an element, developers must ensure that assistive technologies will ignore the element. This is usually the case when hiding decorative parts of a web page.
The issue can be corrected by ensuring the value inside each attribute is spelled correctly and corresponds to a valid value. It’s also important to use appropriate ARIA roles, states, and properties.
<div aria-hidden="true">
<div aria-hidden="false">
<button tabindex="-1">Some button</button>
</div>
</div>
Copy
<div aria-hidden="true">
<a href="/" style="position:absolute; top:-999em">Link</a>
</div>
Copy
<div aria-hidden="true">
<div aria-hidden="false">
<button>Some button</button>
</div>
</div>
Copy
<details aria-hidden="true">
<summary>Some button</summary>
<p>Some details</p>
</details>
Copy
For further examples, visit W3C’s GitHub’s ATC Rules library.