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

Axe error: "Radio inputs with the same name attribute value" violation on radios / checkboxes with conditional reveals #1591

Closed
hannalaakso opened this issue Sep 23, 2019 · 3 comments

Comments

@hannalaakso
Copy link
Member

Running Axe against the radios and checkboxes conditional reveals flags the following error


Radio inputs with the same name attribute value must be part of a group
<input class="govuk-radios__input" id="how-contacted-conditional-1" name="how-contacted" type="radio" value="email" aria-controls="conditional-how-contacted-conditional-1" aria-expanded="false">

To solve this violation, you need to:

Fix at least one (1) of these issues:

All elements with the name "how-contacted" do not reference the same element with aria-labelledby
Fieldset contains unrelated inputs

Some initial findings: #979 (comment)

Originally raised by @injms on alphagov/govuk-design-system

Split off from #979

@hannalaakso hannalaakso added the awaiting triage Needs triaging by team label Sep 23, 2019
@hannalaakso hannalaakso changed the title Investigate "Radio inputs with the same name attribute value" error on conditional reveals Investigate "Radio inputs with the same name attribute value" violation on conditional reveals Sep 23, 2019
@NickColley
Copy link
Contributor

NickColley commented Sep 23, 2019

From Hanna in the other thread:

Error: "Radio inputs with the same name attribute value must be part of a group"

Underlying issue

A bit of a question mark this but it's related to the inputs nested inside the reveals - removing them stops the error.

@36degrees
Copy link
Contributor

Relevant thread: dequelabs/axe-core#176

Particularly, this comment:

Just for the record, here is why that code is currently there: having a radio group like that with the same name, makes the browser interpret certain keyboard commands (up and down arrow) to move the selection and the keyboard focus between the items in the group. If there are a lot of other elements interspersed within that group, this can lead to difficulty understanding where in the form you are (as a screen reader user for example).

Also, in the case of checkbox groupings with much stuff interspersed, the difficulty can be in understanding how all the fields relate to one another.

dequelabs/axe-core#176 (comment)

However, it looks like the rule that triggered this was removed from Axe in 3.4 due to false positives.

@36degrees 36degrees changed the title Investigate "Radio inputs with the same name attribute value" violation on conditional reveals Axe error: "Radio inputs with the same name attribute value" violation on radios / checkboxes with conditional reveals Jul 4, 2022
@querkmachine
Copy link
Member

This violation was removed in Axe 3.4, which is now many, many, many years old (the current version is 3.80!)

I'm going to close off this issue as I don't think there's anything more for us to do here.

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

No branches or pull requests

5 participants