[aria-hidden="true"] elements do not contain focusable descendents

Interactive elements are not hidden from screen reader users.

On this page

Impact

ScanGov impact ratings

About

Focusable descendents within an [aria-hidden="true"] element prevent those interactive elements from being available to users of assistive technologies like screen readers. [Learn how aria-hidden affects focusable elements](https://dequeuniversity.com/rules/axe/4.10/aria-hidden-focus).

Risks

Keyboard users can focus elements that screen readers cannot announce.

Why it's important

Ensures assistive technologies like screen readers can correctly interpret and announce page elements to users with disabilities.

User stories

As a screen reader user, I want ARIA attributes to be correctly implemented so that I can understand the purpose and state of interactive elements.

Code

Failing pattern:

<!-- Fail: focusable button inside aria-hidden container -->
<div aria-hidden="true">
  <button>Close</button>
</div>

Passing pattern:

<!-- Pass: remove aria-hidden, or make element non-focusable -->
<div aria-hidden="true">
  <button tabindex="-1">Close</button>
</div>

Error

ScanGov messaging when a site fails a standard:

Failed: [aria-hidden="true"] elements do not contain focusable descendents

Guidance

Indicators

On this page