-
Notifications
You must be signed in to change notification settings - Fork 793
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
Add custom message for negative tabindex in nested-interactive #3163
Comments
I will try to implement this. Wish me luck. |
Awesome. Let me know if you have any questions. |
I'm trying to reconcile these two statements: In my PR now, the messageKey doesn't mention aria-hidden any more. Only negative tabindex. So does straker's statement render Wilco's statement moot? |
@WilcoFiers Below are the screen reader test results from testing the examples in this demo: https://codepen.io/iamrafan/pen/OJjRqLg
If I run axe-core on the demo page after pulling in the changes from PR #3194 I would see:
Based on the above AT test results I think it is safe to conclude that the nested elements are not accessible to screen readers, which would make the If we conclude that the nested elements are accessible to screen readers based on the AT tests, the |
@iamrafan In VoiceOver and Safari (I haven't tested others), having |
@straker Sure. Considering the nested element is announced by VoiceOver on Safari, wouldn't the |
I see what you mean. Maybe something more along the lines of:
|
* refactor(checks/navigation): improve `internal-link-present-evaluate` Make `internal-link-present-evaluate` work with virtualNode rather than actualNode. Closes issue #2466 * test commit 1 * test commit 2 * test commit 3 * Revert "Merge branch 'dan-test-branch-1' into develop" This reverts commit 428e015, reversing changes made to 9f996bc. * Revert "test commit 1" This reverts commit 9f996bc. * fix(rule): allow "tabindex=-1" for rules "aria-text" and "nested-interactive" Closes issue #2934 * Revert "fix(rule): allow "tabindex=-1" for rules "aria-text" and "nested-interactive"" This reverts commit 30f0e01. * refactor(check): split no-focusable-content rule into three. That rule is now: no-focusable-content-for-aria-text, no-focusable-content-for-nested-interactive, and no-focusable-content-for-frame These three are all copy-and-pastes of each other, so far. * fix(rule): add custom message for nested-interactive. aria-hidden and negative tabindex will trigger messageKey. * style(rule): fix lint errors Errors were in parent commit. * fix(no-focusable-content-for-frame): fix locale files Was broken by recent rename of this check. * refactor(check): undo recent check rename Rename check "no-focusable-content-for-frame" back to "frame-focusable-content". * refactor(check): undo recent split of checks Recombine checks "no-focusable-content-for-aria-text" and "no-focusable-content-for-nested-interactive" back into "no-focusable-content". * refactor(check): rename local variable * fix(rule): make no-focusable-content not consult aria-hidden no-focusable content now consults only tabindex (for the 'not a reliable way of hiding interactive elements' messageKey check) * fix(checks/keyboard): make no-focusable-content use messageKey the right way * refactor(check): misc. renaming and refactoring * Updating description / messageKey text as per #3163 (comment) * add unit test for frame-focusable-content check * update the no-focusable-content unit tests to add a test to capture negative tabindex * update the nested-interactive integration test to add a failure for elements with negative tabindex values * fix(no-focusable-content-for-frame): fix locale files Was broken by recent rename of this check. * Update lib/rules/nested-interactive.json Co-authored-by: Steven Lambert <[email protected]> * Update lib/checks/keyboard/no-focusable-content.json Co-authored-by: Steven Lambert <[email protected]> * fixing botched merge * update rule-descriptions.md * fix locale files Co-authored-by: Steven Lambert <[email protected]>
…#3194) * refactor(checks/navigation): improve `internal-link-present-evaluate` Make `internal-link-present-evaluate` work with virtualNode rather than actualNode. Closes issue dequelabs#2466 * test commit 1 * test commit 2 * test commit 3 * Revert "Merge branch 'dan-test-branch-1' into develop" This reverts commit 428e015, reversing changes made to 9f996bc. * Revert "test commit 1" This reverts commit 9f996bc. * fix(rule): allow "tabindex=-1" for rules "aria-text" and "nested-interactive" Closes issue dequelabs#2934 * Revert "fix(rule): allow "tabindex=-1" for rules "aria-text" and "nested-interactive"" This reverts commit 30f0e01. * refactor(check): split no-focusable-content rule into three. That rule is now: no-focusable-content-for-aria-text, no-focusable-content-for-nested-interactive, and no-focusable-content-for-frame These three are all copy-and-pastes of each other, so far. * fix(rule): add custom message for nested-interactive. aria-hidden and negative tabindex will trigger messageKey. * style(rule): fix lint errors Errors were in parent commit. * fix(no-focusable-content-for-frame): fix locale files Was broken by recent rename of this check. * refactor(check): undo recent check rename Rename check "no-focusable-content-for-frame" back to "frame-focusable-content". * refactor(check): undo recent split of checks Recombine checks "no-focusable-content-for-aria-text" and "no-focusable-content-for-nested-interactive" back into "no-focusable-content". * refactor(check): rename local variable * fix(rule): make no-focusable-content not consult aria-hidden no-focusable content now consults only tabindex (for the 'not a reliable way of hiding interactive elements' messageKey check) * fix(checks/keyboard): make no-focusable-content use messageKey the right way * refactor(check): misc. renaming and refactoring * Updating description / messageKey text as per dequelabs#3163 (comment) * add unit test for frame-focusable-content check * update the no-focusable-content unit tests to add a test to capture negative tabindex * update the nested-interactive integration test to add a failure for elements with negative tabindex values * fix(no-focusable-content-for-frame): fix locale files Was broken by recent rename of this check. * Update lib/rules/nested-interactive.json Co-authored-by: Steven Lambert <[email protected]> * Update lib/checks/keyboard/no-focusable-content.json Co-authored-by: Steven Lambert <[email protected]> * fixing botched merge * update rule-descriptions.md * fix locale files Co-authored-by: Steven Lambert <[email protected]>
Should this issue be closed? I think I fully addressed it with #3194 |
Yup, a little behind on my grooming work. Thanks Daniel! |
See #3159
Even though they seem like they should, things like this just don't work well:
The button / input inside will still be packed up by various AT, that are trying very hard to ensure they don't miss things. This is by no means obvious, and so it would be good to add a specific message key to the no-focusable-content check that reports that using aria-hidden and negative tabindex is not a reliable way of hiding interactive elements. We should have a second message for role=none|presentation and negative tabindex too, just so we don't try to combine too many things.
See ariaErrormessageEvaluate for an example of how to use
messageKey
.The text was updated successfully, but these errors were encountered: