fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

[Accessibility][ChoiceGroup/ChoiceField]: Component should have aria-disabled attribute set when it is disabled

Open ghost opened this issue 9 years ago • 3 comments

For disabled choice group and field, aria-disabled attribute should be specified, else screen readers will have trouble reading it clearly. See this: http://www.w3.org/TR/wai-aria/states_and_properties#aria-disabled

Repro: https://fabricreact.azurewebsites.net/fabric-react/master/#/examples/choicegroup

The html for disabled choicefield is as below: <div class="ms-ChoiceField"><input type="radio" id="ChoiceGroup1846-C" class="ms-ChoiceField-input" name="ChoiceGroup1846" disabled="" aria-describedby="ChoiceGroupDescription1847-C" value="on"><label for="ChoiceGroup1846-C" class="ms-ChoiceField-field is-disabled"><span id="ChoiceGroupDescription1847-C" class="ms-Label">Option C</span></label></div>

Group level disabled should also be handled.

ghost avatar Feb 22 '17 14:02 ghost

disabled elements shouldn't be focussable unless part of a menu or a design pattern clearly specifies it. In case of checkboxes we are using disabled attribute that should prevent focus on these elements, thus we don't need an explicit aria-disabled on these. Does that answer the concern here?

mdahamiwal avatar Feb 22 '17 15:02 mdahamiwal

Hi, As per the ARIA-Practices, the property needs to be set irrespective of the element getting focus or not. Below is a snap from the ARIA page (http://www.w3.org/TR/wai-aria/states_and_properties#aria-disabled)

image

Based on this, I feel we should set the aria-disabled attribute along with disabled tag.

Thanks, Satish

satishc-dev avatar Feb 23 '17 08:02 satishc-dev

Merged March 9th

aleksandrjPersonal avatar May 01 '17 22:05 aleksandrjPersonal