-
Notifications
You must be signed in to change notification settings - Fork 789
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
negative tabindex might give false positive for nested-interactive #3227
Comments
Thanks for the issue. It's not so much that the For example, in VoiceOver and Safari, if you have the following code: <button>
<span tabindex="-1">
This fails... but probably shouldn't
</span>
</button>
<button><span>No interactive child</span></button> If you read letter by letter, when you get to the 2nd button, it will automatically focus that button. However, if you go backwards reading by letter and get to the first button, it will not focus it for you. Same problem if you try to jump to the start of the line. Since you're reading the nested "interactive" child, it doesn't correctly register that your on the button. This means that the screen reader thinks you're on the first button, but really your focus hasn't moved from the 2nd button so you'd click the wrong thing if you tried to activate it. Screen.Recording.2021-10-22.at.8.23.43.AM.movBecause of these issue, we flag the Going to close, but feel free to follow that pr or the other issue. |
Awesome, thanks for such a thorough explanation. Makes sense, appreciate it. |
Example for reference: https://jsfiddle.net/7t4npwyL/
Product: axe-core
Expectation: Elements with
tabindex="-1"
placed inside another interactive element should not always fail nested-interactiveActual: Elements with
tabindex="-1"
placed inside another interactive element always fail nested-interactiveMotivation: To start, I'm not entirely confident that my expectation here is correct, and this is certainly very similar to #2954. However, you see in the example provided that even adding
tabindex="-1"
to a<span>
will fail this rule, when certainly a span is not interactive, and a negative tab index doesn't add any interactivity for the user.The text was updated successfully, but these errors were encountered: