[a11y-defect-2]: VA Button disabled
prop must be true
or undefined | null
for Voice Access to work correctly
#97847
Labels
a11y-defect-2
High-severity accessibility issue that should be fixed in the next 1 - 2 sprints
accessibility
Point of contact
@1Copenut
Severity level
2, Serious. Should be fixed in 1-2 sprints post-launch.
Details
I discovered several
<VaButton>
components would not honor the MS Voice Access command to "Click button name" during an audit of VA Benefit Letters. I root caused the issue to how thedisabled
prop is being updated in the component.Right now, VA Button takes in a Boolean prop
disabled
with a default value offalse
. This prop is used to set the correctaria-disabled
state oftrue | false
.Where this becomes a problem is in how Microsoft Voice Access understands the web component's declaration
disabled=false
. According to the HTML 5 spec,disabled
is a Boolean attribute. Its only acceptable values are to exist (true) or not (null, undefined). When we setdisabled
to false, browsers are able to overcome the issue, but assistive technologies are not always. In this case, the confusion is causing Microsoft Voice Control to ignore click commands entirely.Reproduction steps
<VaButton>
component to a test pagedisabled={false}
in a hard-coded value for easy testingdisabled
prop in code and reload the pageProposed solution or next steps
The default value
false
needs to be updated toundefined
for this component. Users should only be adding thedisabled
prop when they need to disable a button and use logic to ensure the only values it can receive aretrue | null | undefined
.References, articles, or WCAG support
Type of issue
The text was updated successfully, but these errors were encountered: