Skip to content

noAriaHiddenOnFocusable (HTML)

biome.json
{
"linter": {
"rules": {
"a11y": {
"noAriaHiddenOnFocusable": "error"
}
}
}
}

Enforce that aria-hidden=“true” is not set on focusable elements.

aria-hidden="true" can be used to hide purely decorative content from screen reader users. A focusable element with aria-hidden="true" can be reached by keyboard. This can lead to confusion or unexpected behavior for screen reader users.

<div aria-hidden="true" tabindex="0"></div>
code-block.html:1:1 lint/a11y/noAriaHiddenOnFocusable  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Incorrect use of aria-hidden="true" detected.

> 1 │ <div aria-hidden="true" tabindex="0"></div>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 │

aria-hidden should not be set to true on focusable elements because this can lead to confusing behavior for screen reader users.

Unsafe fix: Remove the aria-hidden attribute from the element.

1 │ <div·aria-hidden="true"·tabindex="0"></div>
-------------------
<a href="/" aria-hidden="true">link</a>
code-block.html:1:1 lint/a11y/noAriaHiddenOnFocusable  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Incorrect use of aria-hidden="true" detected.

> 1 │ <a href="/" aria-hidden="true">link</a>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 │

aria-hidden should not be set to true on focusable elements because this can lead to confusing behavior for screen reader users.

Unsafe fix: Remove the aria-hidden attribute from the element.

1 │ <a·href="/"·aria-hidden="true">link</a>
------------------
<div aria-hidden="true"></div>
<button aria-hidden="true" tabindex="-1"></button>