-
Notifications
You must be signed in to change notification settings - Fork 781
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
label-content-name-mismatch should consider cases that don't use aria-label
(such as sr-only elements)
#4261
Comments
Thanks for the issue. The reason the example provided fails is that the accessible name of the button does not match the beginning of the
|
Thanks for the suggestion. We'll look into what it would take to implement this. Since the original issue and this suggestion are a bit different, I'm going to update the title of the issue to describe the feature rather than the bug so we can track this easier. |
aria-label
(such as sr-only elements)
Product
axe-core
Feature Description
Take the following HTML with accessible names defined via
aria-label
:Variants 1 and 2 pass the "label-content-name-mismatch" rule because it just checks the prefix of the
aria-label
against the actual text content of the node. Variant 3 fails the test becauseall of my
is inserted in the middle of the label, but is clearly a more descriptive label for the given button.The "label-content-name-mismatch" rule should be more relaxed and just check if all words of the accessible name are in occuring in the same order as in the visible text.
Here a screenshot of a concrete example in Lightouse 11 with axe-core 4.8:
Should pass
Should fail
The text was updated successfully, but these errors were encountered: