Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flag tabindex when greater than 0 #7

Closed
ecerta opened this issue Jan 5, 2019 · 1 comment
Closed

Flag tabindex when greater than 0 #7

ecerta opened this issue Jan 5, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@ecerta
Copy link
Contributor

ecerta commented Jan 5, 2019

Is your feature request related to a problem? Please describe.
tabindex should only ever have a value of 0 or -1, except in SUPER RARE exceptions in which case the developer would know enough about tabindex to ignore the linter.

This is an accessibility issue because messing with tabindex messes with keyboard accessibility in ways many developers do not realize.

Describe the solution you'd like
Add a check for tabindex=, then any number following that is greater than 0

Describe alternatives you've considered
It is possible to leave this off because again, there are very, very rare cases where tabindex greater than 0 is warranted, such as a page with a circular structure, but far more common is developers thinking they're helping their page by putting tabindex=1 on the logo at the top of the page, not realizing that this can interfere in cases where, for example, a modal closes and focus should return to where it was before it opened but instead it jumps to the top of the page.

Additional context
More info on tabindex: https://webaim.org/techniques/keyboard/tabindex

@mvdschee mvdschee added the enhancement New feature or request label Jan 7, 2019
@mvdschee mvdschee self-assigned this Jan 7, 2019
@mvdschee
Copy link
Owner

mvdschee commented Jan 7, 2019

@ecerta That is indeed a big problem, I will for sure add it to the checks.

mvdschee pushed a commit that referenced this issue Jan 8, 2019
@mvdschee mvdschee mentioned this issue Jan 8, 2019
Merged
@mvdschee mvdschee closed this as completed Jan 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants