-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renamed rule avoid-positive-tabindex to tabindex-no-positive to be mo…
…re inline with the rule naming in eslint-plugin-jsx-a11y
- Loading branch information
Erin Doyle
committed
Oct 6, 2018
1 parent
4bcb769
commit 73c69e6
Showing
5 changed files
with
42 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# tabindex-no-positive | ||
|
||
It is recommended that authors avoid positive values for the `tabindex` attribute because it is | ||
brittle (any focusable elements added to the page without an explicit `tabindex` value greater than | ||
zero will come last in the tab order) and can easily result in a page which is extremely difficult | ||
to navigate, causing accessibility problems. Only use a `tabindex` of 0 for focusable elements. | ||
|
||
|
||
## options | ||
|
||
*This rule takes no options* | ||
|
||
## Passes | ||
|
||
```jsx harmony | ||
<div tabIndex={0} /> | ||
<div tabIndex="0" /> | ||
<div tabIndex="-1" /> | ||
``` | ||
|
||
## Fails | ||
|
||
```jsx harmony | ||
<div tabIndex={1} /> | ||
<div tabIndex="1" /> | ||
<div tabIndex="2" /> | ||
``` | ||
|
||
## See also | ||
|
||
- [This document](https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_focus_03) | ||
from Chrome Accessibility Developer Tools. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters