dequelabs / axe-core

Accessibility engine for automated Web UI testing
https://www.deque.com/axe/
Mozilla Public License 2.0
5.86k stars 762 forks source link

Add "radiogroup should have an accessible name" as a best practice #3658

Open vgpena opened 2 years ago

vgpena commented 2 years ago

Product

axe-core

Feature Description

Hi axe-core folks, I am opening a new issue in the vein of https://github.com/dequelabs/axe-core/issues/3256.

I would like to be alerted when elements with role="radiogroup" don't have a name that can be programmatically determined. I like this suggestion of adding this as a best practice instead of a violation, given that WCAG and WAI-ARIA treat this requirement differently.

Even though a11ysupport.io marks this feature as only "partially supported" by JAWS, drilling down into the specifics shows that JAWS consistently knows about the radiogroup's name. This broad support makes "radiogroup should have a name" a strong candidate for being represented somehow in axe-core.

If this sounds generally good, I can fill out a new rule template.

WilcoFiers commented 1 year ago

Thank you for the suggestion @vgpena. My opinion on it hasn't changed on this. I think there are too many cases where there is no reason to require an accessible name, especially if there isn't an obvious visible label for the group. It's a good practice, but I'm not sure it raises to the level of a best practice. I'll ask around though to see what others think.

vgpena commented 1 year ago

Thanks @WilcoFiers , I appreciate your consideration either way!

scottaohara commented 1 year ago

while i agree with your opinion on this Wilco, I also would like to see this surfaced and tagged as "needs review". Yes, there are situations where if the radio group has no accessible name, but the labels of each radio are descriptive to the point of implying the group's purpose, then a specific name for the group is likely not necessary. But leaving this out of the automated checks all together means valid issues could be left on the cutting room floor.

WilcoFiers commented 1 year ago

That's fair enough I suppose. If someone explicitly uses role="radiogroup", and then doesn't give it an accessible name, there's a good chance that something is wrong. Needs review might be appropriate. Would anyone be up for creating such a rule? I think a new rule that uses the "reviewOnFail" option will work best for something like this.