Rule
Focusable hidden content
Nothing focusable may sit inside aria-hidden="true".
- Rule
aria-hidden-focus- WCAG 2.2
- 4.1.2 Name, Role, Value (opens in a new tab) (Level A)
- Severity
- Serious
What it checks
The rule looks at every element with aria-hidden="true", and inside it, for anything a keyboard can reach: links, buttons, form fields, <summary>, frames, media with controls, editable regions and elements with a tabindex. It fails when one is rendered and reachable with Tab, because keyboard users then land on something a screen reader cannot see.
Controls taken out of the tab order with a negative tabindex, disabled controls, content inside inert, content that is not displayed and controls at zero opacity do not count.
When a person decides
While a modal dialog is open, the page behind it is often hidden on purpose and a script keeps focus inside the dialog. The markup cannot show whether that trap works, so in that case the finding is sent for review, to be checked with a keyboard.
Example
Fails
<div class="slide" aria-hidden="true">
<h3>Winter sale</h3>
<a href="/sale/">Shop the sale</a>
</div>
Passes
<div class="slide" aria-hidden="true" inert>
<h3>Winter sale</h3>
<a href="/sale/">Shop the sale</a>
</div>
The engine is tested against both examples.
How to fix it
Add inert to the hidden content, or take each control inside it out of focus with tabindex="-1" or disabled. If the content is meant to be used, remove aria-hidden.
Check your own pages
This rule runs in every pour audit: the browser extension, the bookmarklet, the command line and the editor. Get pour, free.