Description
To disable a certain Radio button in a RadioGroup of FormControls, you need to set the disabled prop on the FormControl element of the radio option. If you do, you get the following axe violation
helpers.ts:37 [Critical] [aria-disabled] may be used in place of native HTML [disabled] to allow tab-focus on an otherwise ignored element. Setting both attributes is contradictory.
https://www.w3.org/TR/html-aria/#docconformance-attr
When you inspect the element in the DOM it indeed has both disabled and aria-disabled="true" HTML attributes.
Steps to reproduce
Render this JSX:
<RadioGroup name="options">
<RadioGroup.Label>Options</RadioGroup.Label>
<FormControl>
<Radio value="option1" />
<FormControl.Label>Option 1</FormControl.Label>
</FormControl>
<FormControl disabled>
<Radio value="option2" />
<FormControl.Label>Option 2</FormControl.Label>
</FormControl>
</RadioGroup>
Version
35.14.2
Browser
Chrome
Description
To disable a certain
Radiobutton in aRadioGroupofFormControls, you need to set thedisabledprop on theFormControlelement of the radio option. If you do, you get the following axe violationWhen you inspect the element in the DOM it indeed has both
disabledandaria-disabled="true" HTML attributes.Steps to reproduce
Render this JSX:
Version
35.14.2
Browser
Chrome