Enforce that elements that have an onClick
handler also have
a tabIndex
property. If not, they will not be navigable by
keyboard users.
This rule takes no options
// passes when when there is an `onClick` with a `tabIndex`
<span onClick={someFunction} tabindex="0"></span>
// passes when the element is hidden from aria
<span onClick={someFunction} aria-hidden="true"></span>
// passes when the element is interactive
<button onClick={someFunction}></button>
// fails when there is an `onClick` with no `tabIndex`
<span onClick={someFunction}></span>
- This document from github.com/GoogleChrome
- This document from w3.org