adobe / adobe/spectrum-web-components

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

Open
#3,571 2 comments 0 reactions 0 assignees View on GitHub
a11y Component:Radio Deprecation Good first issue
Dominant language
TypeScript
Stars
1.5k
Forks
262
Avg merge
3d 10h
Merged PRs (30d)
68

Description

### Code of conduct

- [X] I agree to follow this project's code of conduct.

### Description of issue

In [updating documentation](https://github.com/adobe/spectrum-web-components/pull/3558) 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

Contributor guide

Open the contributing guide

Research direction

Start with the Radio component's updated(changes:) logic and trace how invalid state is handled by the Radio Group. Confirm the WAI-ARIA guidance linked in the issue, then update the components so invalid state is represented on the group rather than an individual Radio and verify the related behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
accessibility, frontend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.