adobe / spectrum-web-components

Spectrum Web Components
https://opensource.adobe.com/spectrum-web-components/
Apache License 2.0
1.25k stars 200 forks source link

Remove deprecated support for aria-invalid state on the Radio Component #3571

Open jnjosh opened 1 year ago

jnjosh commented 1 year ago

Code of conduct

Description of issue

In updating documentation on properly showing invalid state in radio groups (#3005). We discussed removing the invalid attribute from the Radio component—favoring the Radio Group instead. In talking with the accessibility team we learned:

In WAI-ARIA 1.2, the aria-invalid state is deprecated on role="radio" (see “inherited states and properties” under https://www.w3.org/TR/wai-aria-1.2/#radio), and I don’t think that screen readers will be consistent about announcing the invalid state when aria-invalid is specified on a input[type=radio], adding aria-invalid to the role="radiogroup" is the recommended approach, (see “supported states and properties” under https://www.w3.org/TR/wai-aria-1.2/#radiogroup).

The Radio component itself will apply this deprecated invalid attribute in updated(changes:) which based on this new understanding, is deprecated behavior. The component should be updated to properly represent invalid state in the Radio Group, not on the individual Radio element.

Discussion from PR: https://github.com/adobe/spectrum-web-components/pull/3558#discussion_r1301557678

najikahalsema commented 1 year ago

We should check to see if there are any other deprecated ARIA attributes, in radio or otherwise.