-
Notifications
You must be signed in to change notification settings - Fork 794
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
Check button-name failed with aria-roledescription #4679
Comments
This is certainly an interesting case. There is a lot to unpack here. First up, good job testing this out. That's always an important step when working with newer ARIA features. If we do end up making a change for this we'd have to check JAWS too. can role description provide a name?I'm not sure I know the answer right away. I'll just write out my thought process here and I'll talk to some more people to get their view on this too. Generally, controls require both a role and a name. What you're doing with However, while WCAG requires elements to have a role & name, it does not require those to be conveyed through the correct properties in the accessibility tree. Before ARIA was widely supported (and it still isn't in some local screen readers), people used to put state information in the accessible name. Instead of using aria-current on a link someone might have add a text like (current page) to a link's accessible name. And that would be a reasonable way to provide that information. This seems similar to that scenario, which is why I'm leaning towards that this might be okay. I don't think I'd go so far as to say this passes, but maybe this should go to needs review instead of a violation. do menus need names?The other issue I'm seeing here is with your specific What this has me wondering about is whether an element's role can ever be also its name. For most controls the answer is an obvious no. A link needs a name because otherwise you don't know where it goes. And just giving it the name of "link" is still insufficient because it doesn't describe its purpose. But a name of "menu" often does seem sufficient, especially if it's the only menu on the page. Kind of how if a landmark only exists once in the page it doesn't need a name to distinguish it. So I'm kind of leaning towards saying that menus without an accessible name, if they're the only menu on the page probably shouldn't be failed. Maybe we should even just pass them. |
Thank you for your detailed answer. |
I checked in JAWS 2025 And JAWS behaves differently, on other similar buttons on the page, ignore attriubute |
Product
axe-core
Product Version
4.10.2
Latest Version
Issue Description
Expectation
I use attribute
aria-roledescription
to redefine default announce like "Button" to discernible text, example "Expandable menu"if i just set aria-label and aria-expanded, screenreader announce excess text.
Actual
<button aria-roledescription="Aria Name" />
failbutton-name
check with errorhttps://dequeuniversity.com/rules/axe/4.10/button-name?application=axeAPI
How to Reproduce
example with button and aria-roledescription https://principled-kindhearted-oyster.glitch.me/
Additional context
I test aria-roledescription and it work in Windows NVDA , macOS VoiceOver, Android TalkBack
The text was updated successfully, but these errors were encountered: