Fix incorrect markup on radio buttons and checkbox components to support accessibility #3363
Open
2 of 6 tasks
Labels
accessibility
Any Section 508 or accessibility issue
bug
Something isn't working
platform-design-system-team
va-checkbox
va-radio
Bug Report
This is related to the recently closed issue regarding support for Voice control users
What happened
When doing foundational testing, my team noticed that multiple axe errors were being flagged on the radio button component regarding ARIA attributes being used incorrectly - in this case the
role
and subsequently thearia-checked
attributes are not allowed on a<label>
tag:This is also the case on the checkbox component, the same attributes are being used incorrectly here as well.
What I expected to happen
I would expect that no axe errors would be flagged for the component and that ARIA attributes would be used correctly.
However, after investigating the reason for adding the attributes and the various requirements, this was a complex issue and I wanted to propose a solution rather than just stating the issue.
I did some research and I may have a possible solution that is accessible and support voice control:
This is the codepen I was working on. It currently just has the radio button example I was working on though I may work on a checkbox one as well.
I also was able to briefly change the component to my implemention and test, because I wanted to see how the shadow DOM might impact this. And while Voice Control did work, I am not able to test thoroughly. I still do feel that using the semantic elements (vs the current implementation with the axe errors) is a better option but I would recommend more testing of the component itself.
Urgency
How urgent is this request? Please select the appropriate option below and/or provide details
Details
While it's not blocking work, the current implementation has incorrect markup and is used quite often throughout the VA.gov site. It would be a great improvement to address this and to pass it along to USWDS
Estimating
Provide your estimate of 1, 2, 3, 5, 8 or 13
@Andrew565 - 5
@ataker - 5
@harshil1793 - 5
@it-harrison - 5
@jamigibbs -
@micahchiang - 5
@powellkerry - 5
@rmessina1010 -
@rsmithadhoc - 5
The text was updated successfully, but these errors were encountered: