ARIA hidden element must not be focusable or contain focusable elements
How to fix the aria-hidden-focus accessibility rule. Names of links, buttons and controls.
What this rule checks
Ensure aria-hidden elements are not focusable nor contain focusable elements
Who is affected
Something hidden from screen readers with aria-hidden="true" can still be reached with the Tab key, so keyboard users land on an element that is announced as nothing.
How to fix it
Remove aria-hidden, or make the content inside unfocusable (tabindex="-1" or the inert attribute).
WCAG success criteria
When this rule fails, the page fails:
- 4.1.2 Name, Role, Value (Level A, WCAG 2.0, 2.1, 2.2)
Find it on your own page
Scan a web page and the report lists every element that fails this rule, with screenshots outlining where they are, the code, and a selector you can paste into your browser’s developer tools.
More detail
- Deque University’s reference for aria-hidden-focus (the makers of axe-core, the engine our scanner uses)
- All fix guides