react-a11y
Version:
Warns about potential accessibility issues with your React elements.
39 lines (25 loc) • 926 B
Markdown
Enforce that interactive elements that have been removed from
the accessibility tree using `aria-hidden` are also removed from
the tab flow by setting `tabIndex={-1}`. If not, this could result
in a hidden tab stop for screen reader users.
*This rule takes no options*
```jsx harmony
// passes when an interactive element is aria-hidden and has tabindex="-1"
<input aria-hidden="true" tabindex="-1"/>
// passes when the element is not interactive
<div aria-hidden="true"></div>
// passes when an interactive element is not aria-hidden
<input/>
```
```jsx harmony
// fails when an interactive element is hidden but has no tabindex
<input aria-hidden="true"/>
// fails when an interactive element is hidden but has a bad tabindex
<input aria-hidden="true" tabindex="2"/>
```
- [This document](http://john.foliot.ca/aria-hidden) from john.foliot.ca