chore: hidden and aria-hidden for nested-interactive#3159
Conversation
|
|
|
Thanks for the pr. Unfortunately I don't think this works as expected. Using <div role="button"><button aria-hidden="true">My Button</button></div>
However, as to whether or not this particular case should fail the |
|
I agree the correct combination would be
For me this is a variant of the same thing but I don't know if you shared this opinion. |
056a3d4 to
1323278
Compare
|
So talking with Wilco we determined that since the example fails |
straker
left a comment
There was a problem hiding this comment.
You'll also need to edit https://github.com/dequelabs/axe-core/blob/develop/test/integration/rules/nested-interactive/nested-interactive.json and add the new ids to the list of fail / passes.
test/integration/rules/nested-interactive/nested-interactive.html
Outdated
Show resolved
Hide resolved
Co-authored-by: Steven Lambert <2433219+straker@users.noreply.github.com>
|
Tested the following snippet with a colleague the other day - with Dragon both checkboxes in the following markup snippet were still exposed; <div role=checkbox aria-checked=true tabindex=0 aria-label=foo>
<input type=checkbox aria-hidden=true tabindex=-1> <!-- visually hidden -->
</div>Using VoiceOver and the down arrow key alone to read line-by-line, the visually hidden checkbox is still reached, causing a focus stop without an announcement. While screen readers are trying to error correct for author blunders like these, it's not bullet proof across all other AT - more of which still needs testing. For instance, testing the proposed 'passing' snippet specific to this issue with Edge/Narrator, Narrator can reach the outer button and it will be announced with no name (which makes sense because the 'pass' is within the nested button that's set to I'd request that this be taken into consideration before passing stuff that can still pose issues, and would not discourage authors from poor coding practices. Thanks |
|
Apologies for the slowed response. I've been a little reluctant to dive into this. Scott is right in that this pattern just doesn't work very well, and that you probably just shouldn't use it. I think what needs to happen is that we create a new failure message, specifically to explain that using negative tabindex can still cause problems. I'll create an issue for this. |
|
I believe this pr is replaced by #3194, since we don't want tabindex=-1 to pass but now warn of the problem. |
|
Going to close this issue. Negative tabindex will now produce a warning stating that it won't prevent assistive technologies from focusing the element. In terms of the number of rule failures, I believe all 3 should be reported for the following reason: If the user starts with this HTML: <div role="button"><button aria-hidden="true">My Button</button></div>We report 3 failures: <div role="button" aria-label="My Button"><button tabindex="-1" aria-hidden="true">My Button</button></div>Which should correctly produce a |
The standard technique for hiding content for all users has been the use CSS display:none. Now, both ARIA and HTML5 also provide a semantic indication of content state that indicates content is hidden or should not be available to users
In nested interactive controls they would have the same behavior if hidden pass the test; aria-hidden=true test would behave in the same way