SIA-R17Elements with aria-hidden="true"
are not focusable
Accessibility requirements
This rule tests conformance of the following accessibility requirements:
Description
This rule checks that elements that have been excluded from the accessibility tree using the aria-hidden
attribute with a value of true
are not, nor have descendants that are, focusable.
Applicability
This rule applies to every element with an aria-hidden
attribute with a value of true
.
Expectations
- The target element does not have any inclusive descendant in the flat tree that is focusable.
Assumptions
-
This rule assumes that focusing elements does not change their
aria-hidden
attribute. If scripting removes thearia-hidden
attribute upon receiving focus, this rule will produce incorrect results. Note that this is still not a great user experience since it prevents Assistive Technology users from knowing the content of the page before interacting with it. -
This rule assumes that focusable elements do not redirect focus immediately upon receiving it. Modal windows sometimes have "focus sentinel" to redirect focus at their top upon reaching the bottom. In such a case, the interactive elements outside of the modal are technically focusable but will never effectively receive focus nor cause an accessibility problem.
Accessibility support
This rule has no known accessibility support concerns.
Examples
Passed
This element has been excluded from the accessibility tree but is not focusable and therefore passes the rule:
<div aria-hidden="true">
<p>This is some text</p>
</div>
This otherwise focusable element has been excluded from the accessibility tree and made unfocusable using a negative tabindex
and therefore passes the rule:
<button aria-hidden="true" tabindex="-1">This is a button</button>
Failed
This element has been excluded from the accessibility tree but is still focusable and therefore fails the rule:
<button aria-hidden="true">This is a button</button>
Inapplicable
This element has not been excluded from the accessibility tree and is therefore inapplicable:
<button>This is a button</button>
Acknowledgments
This document includes material copied from or derived from https://www.w3.org/WAI/standards-guidelines/act/rules/6cfa84/. Copyright © 2024 W3C® (MIT, ERCIM, Keio, Beihang).