Skip to content

[radio] Remove unnecessary ARIA attributes from RadioRoot component - #5213

Merged
sai6855 merged 4 commits into
mui:masterfrom
sai6855:radio-role
Jul 13, 2026
Merged

sai6855 merged 4 commits into
mui:masterfrom
sai6855:radio-role

Conversation

@sai6855

@sai6855 sai6855 commented Jul 13, 2026 •

Copy link
Copy Markdown
Member

Per WAI-ARIA 1.2 aria-required / aria-readonly aren't supported on role=radio element, instead they are supported on radiogroup role

Supported states for radio role

image

Supported states for radiogroup role

image

@pkg-pr-new

pkg-pr-new Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
  • base-ui-tanstack-start

  • vite-css-base-ui-example

    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/react@5213
    
    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/utils@5213
    

commit: d555cbb

@code-infra-dashboard

code-infra-dashboard Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react ▼-58B(-0.01%) ▼-6B(0.00%)

Details of bundle changes

Performance

Total duration: 1,431.50 ms +148.14 ms(+11.5%) | Renders: 78 (+0) | Paint: 2,241.61 ms +244.53 ms(+12.2%)

Test Duration Renders
Tabs mount (200 instances) 277.63 ms 🔺+63.18 ms(+29.5%) 4 (+0)
Slider mount (300 instances) 222.43 ms 🔺+55.23 ms(+33.0%) 3 (+0)
Checkbox mount (500 instances) 94.42 ms 🔺+21.15 ms(+28.9%) 1 (+0)
Dialog mount (300 instances) 67.09 ms 🔺+21.04 ms(+45.7%) 1 (+0)
Tooltip mount (300 contained roots) 60.26 ms 🔺+15.31 ms(+34.1%) 1 (+0)

…and 1 more (+8 within noise) — details

Metric alarms

Test Metric Change
Tabs mount (200 instances) bench:paint 🔺 +93.17 ms
Slider mount (300 instances) bench:paint 🔺 +88.28 ms
Checkbox mount (500 instances) bench:paint 🔺 +30.44 ms
Dialog mount (300 instances) bench:paint 🔺 +32.86 ms
Tooltip mount (300 contained roots) bench:paint 🔺 +24.21 ms

Check out the code infra dashboard for more information about this PR.

@sai6855 sai6855 added type: bug It doesn't behave as expected. radio labels Jul 13, 2026
@netlify

netlify Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit d555cbb
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6a54c5a9b220f60008e10749
😎 Deploy Preview https://deploy-preview-5213--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@sai6855
sai6855 marked this pull request as ready for review July 13, 2026 07:14
Copilot AI review requested due to automatic review settings July 13, 2026 07:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Base UI’s RadioRoot accessibility attributes to align with WAI-ARIA 1.2 by removing unsupported states from elements with role="radio".

Changes:

  • Removed aria-required and aria-readonly from RadioRoot’s role="radio" element.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 138 to 142
const rootProps: React.ComponentPropsWithRef<'span'> = {
role: 'radio',
'aria-checked': checked,
'aria-required': required || undefined,
'aria-readonly': readOnly || undefined,
'aria-labelledby': ariaLabelledBy,
[ACTIVE_COMPOSITE_ITEM as string]: checked ? '' : undefined,
@sai6855
sai6855 enabled auto-merge (squash) July 13, 2026 10:58
@sai6855
sai6855 merged commit b225ed7 into mui:master Jul 13, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

radio type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants