Hidden element can still be focused

  • WCAG 4.1.2 Name, Role, Value, level A
  • Serious
  • ARIA
  • Automated
  • Server pass

Why it matters

aria-hidden="true" hides an element from screen readers but not from the keyboard. Focus lands on something that is not announced.

How to fix it

Remove aria-hidden, or make the element unfocusable (tabindex="-1", the inert attribute, or hide it with display:none).

<!-- Before -->
<a href="/x/" aria-hidden="true">Hidden link</a>

<!-- After -->
<a href="/x/">Visible link</a>

Read the W3C guidance: Understanding 4.1.2 Name, Role, Value.

Related rules

Find this on your own site. A11yMate scans every page and lists where it happens. See pricing or browse all rules.