Skip to content

fix(onboarding): Remove broken aria-label from RadioGroup radio inputs#116032

Merged
scttcper merged 2 commits into
masterfrom
scttcper/fix-radio-aria-label
May 21, 2026
Merged

fix(onboarding): Remove broken aria-label from RadioGroup radio inputs#116032
scttcper merged 2 commits into
masterfrom
scttcper/fix-radio-aria-label

Conversation

@scttcper
Copy link
Copy Markdown
Member

RadioGroup was calling .toString() on a React.ReactNode to build aria-label for each radio input, which produced aria-label="[object Object]" whenever the label was JSX. The wrapping <label> element already provides the accessible name, so the explicit aria-label was redundant and actively harmful.

RadioGroup was calling `.toString()` on a `React.ReactNode` to set
`aria-label` on each radio input, which produced `[object Object]` for
any JSX label. The wrapping `<label>` element already provides the
accessible name, so the explicit `aria-label` was redundant and actively
harmful.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.62%

`RadioGroup` was calling `.toString()` on a `React.ReactNode` to set
`aria-label`, which produced `[object Object]` for any JSX label. Only
set `aria-label` when the label is actually a string, otherwise let the
wrapping `<label>` element provide the accessible name.

Switch existing tests to use `getByRole('radio')` so they actually catch
this kind of breakage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@scttcper scttcper changed the title fix(ui): Remove broken aria-label from RadioGroup radio inputs fix(onboarding): Remove broken aria-label from RadioGroup radio inputs May 21, 2026
@scttcper scttcper marked this pull request as ready for review May 21, 2026 18:01
@scttcper scttcper requested review from a team as code owners May 21, 2026 18:01
@scttcper scttcper merged commit d3ea266 into master May 21, 2026
72 checks passed
@scttcper scttcper deleted the scttcper/fix-radio-aria-label branch May 21, 2026 18:02
natemoo-re pushed a commit that referenced this pull request May 21, 2026
#116032)

`RadioGroup` was calling `.toString()` on a `React.ReactNode` to build
`aria-label` for each radio input, which produced `aria-label="[object
Object]"` whenever the label was JSX. The wrapping `<label>` element
already provides the accessible name, so the explicit `aria-label` was
redundant and actively harmful.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants