Skip to content
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

Incorrect aXe / Assure violation: Elements must only use allowed ARIA attributes: for aria-required on radio button #540

Closed
spanchang opened this issue Sep 20, 2017 · 14 comments · Fixed by #629

Comments

@spanchang
Copy link

spanchang commented Sep 20, 2017

Example: <input aria-required="true" name="contactme" value="email" type="radio">

The ARIA specs note that
i. aria-required is related to the HTML 'required' attribute
ii. Unless an exactly equivalent native attribute is available, host languages SHOULD allow authors to use the aria-required attribute on host language form elements that require input or selection by the user.

The HTML5 specs say:
For radio buttons, the required attribute is satisfied if any of the radio buttons in the group is selected.

To avoid confusion as to whether a radio button group is required or not, authors are encouraged to specify the attribute on all the radio buttons in a group.
Indeed, in general, authors are encouraged to avoid having radio button groups that do not have any initially checked controls in the first place, as this is a state that the user cannot return to, and is therefore generally considered a poor user interface.

===

Also IMO: It cannot be a best practice recommendation. Not having the attribute on radio button(s) does not enhance accessibility nor is it counter to the specs.

@WilcoFiers
Copy link
Contributor

Yep, I think you're right. This looks fine to me. I did a quick test with VO, which doesn't seem to mind. I don't expect other AT will mind either but we'll need to be sure. Have you tested this with NVDA and JAWS to see if there are any support issues that come up?

@spanchang
Copy link
Author

spanchang commented Sep 20, 2017 via email

@marcysutton
Copy link
Contributor

We should check Mobile VO and TalkBack, as well.

@spanchang
Copy link
Author

spanchang commented Sep 20, 2017 via email

@dylanb
Copy link
Contributor

dylanb commented Sep 20, 2017

@spanchang actually, according to the normative portion of the WCAG standard called "accessibility supported", it can be a WCAG failure https://www.w3.org/TR/WCAG20/#accessibility-supporteddef

Specifically, unless you can guarantee a specific combination of technologies where the technique does work (which a system like axe-core cannot assume), if it does not work on a platform your application users use, then it is a WCAG failure.

@KittyGiraudel
Copy link
Contributor

Is axe-core reporting a false-positive regarding aria-required on radios and checkboxes then?

@WilcoFiers
Copy link
Contributor

@hugogiraudel Yes. We'll have to allow aria-required on those. If you're interested, feel free to create a pull request fixing this issue.

@dylanb
Copy link
Contributor

dylanb commented Dec 1, 2017

@WilcoFiers This creates a bit of a conundrum...

S.C. 4.1.1 is about forwards compatibility - and these attributes are not allowed on these roles per the current ARIA spec (so we should fail this)
S.C. 4.1.2 is about does it work (so we should pass this)

All the attributes are bunched into a single rule so we cannot differentiate.

What to do?

@dylanb
Copy link
Contributor

dylanb commented Dec 1, 2017

Also, what does it mean (semantically) to have aria-required="true" on all the radio buttons in a group where you can only select one radio button?

@WilcoFiers
Copy link
Contributor

I disagree about our ARIA rules falling under 4.1.1 in the first place. We've had that discussion before. 4.1.1 asks for 4 very specific things: 1) Have required start/end tags, 2) Correct nesting, 3) No duplicate attributes, 4) IDs are unique. Valid ARIA isn't one of them. I suppose you could argue that it's in line with what this is asking, sure, but the text of the SC isn't asking for it. In my mind, all of our ARIA rules should be 4.1.2, and for certain scenarios 1.3.1. We've never distinguished them at that level though, and I wouldn't think this is the PR to sort this out in.

@marcysutton
Copy link
Contributor

I would love some clarification on this language:

Unless an exactly equivalent native attribute is available, host languages SHOULD allow authors to use the aria-required attribute on host language form elements that require input or selection by the user.

Isn't required an equivalent native attribute for INPUT? It's equivalent in terms of the accessibility tree, but I suppose not equivalent for HTML5 input validation.

@dylanb
Copy link
Contributor

dylanb commented Dec 3, 2017

@marcysutton where did you pull that language from?

@marcysutton
Copy link
Contributor

@dylanb from the description of this issue, @spanchang wrote it in the section on "ARIA specs note that..."

@spanchang
Copy link
Author

spanchang commented Dec 4, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants