Accessibility
a11y/aria-hidden-focusable
aria-hidden="true" is never on a focusable element or on an element that contains one.
seriousstaticWCAG 4.1.2 · Afe-a11y-aria
Why
aria-hidden removes an element from what a screen reader announces but not from the Tab order. Keyboard focus then lands on something that has no name and no role: the user hears silence or "blank".
Fix
Hide content from everyone with hidden or inert (inert also removes it from focus and from pointer use), or take the controls out of the hidden part. Use aria-hidden="true" only on decoration such as icons and duplicated visuals with nothing focusable inside.
Examples
<!-- bad: an off-screen drawer hidden only from screen readers -->
<nav aria-hidden="true"><a href="/">Home</a></nav>
<!-- good -->
<nav inert><a href="/">Home</a></nav>
<svg aria-hidden="true" focusable="false">…</svg>Sources
Facts
- Id
a11y/aria-hidden-focusable- Severity
- serious
- Check
- static checked in the source by
audit - Applies to
htmlangularvuesvelteastrojsx- WCAG 2.2
- 4.1.2, level A
- Same problem in
- axe-core
aria-hidden-focus, Lighthousearia-hidden-focus - Taught by the skill
fe-a11y-ariaARIA, names and live regions- Since version
- 0.1.0
Read it in the terminal
npx github:dawidolko/frontend-skills explain a11y/aria-hidden-focusable