Skip to content

[radio] Fix Radio to trigger on space key press - #4930

Merged
atomiks merged 2 commits into
mui:masterfrom
chuganzy:radio-space-trigger
May 28, 2026
Merged

atomiks merged 2 commits into
mui:masterfrom
chuganzy:radio-space-trigger

Conversation

@chuganzy

Copy link
Copy Markdown
Contributor

Radio should trigger on Space as per the WAI-ARIA radio pattern:
https://www.w3.org/WAI/ARIA/apg/patterns/radio/

Previously, useButton ran onClick from onKeyDown, but Radio's click handler ignored it because the event was defaultPrevented.

Unlike other "composite items", it is more natural for Radio to activate on keyUp, so this fixes Space key activation by setting composite: false on useButton.

@pkg-pr-new

pkg-pr-new Bot commented May 28, 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@4930
    
    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/utils@4930
    

commit: fed6399

@netlify

netlify Bot commented May 28, 2026

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit fb4ec95
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6a17d1b70dd0dd0008d4c955
😎 Deploy Preview https://deploy-preview-4930--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.

@code-infra-dashboard

code-infra-dashboard Bot commented May 28, 2026 •

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react 🔺+13B(0.00%) 🔺+6B(0.00%)

Details of bundle changes

Performance

Total duration: 1,085.13 ms -167.91 ms(-13.4%) | Renders: 50 (+0) | Paint: 1,640.53 ms -255.93 ms(-13.5%)

Test Duration Renders
Select mount (200 instances) 118.80 ms ▼-39.54 ms(-25.0%) 3 (+0)
Popover mount (300 instances) 57.70 ms ▼-16.41 ms(-22.1%) 1 (+0)

10 tests within noise — details


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

@netlify

netlify Bot commented May 28, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit fed6399
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6a17f939457afa0007cd243b
😎 Deploy Preview https://deploy-preview-4930--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.

@chuganzy
chuganzy force-pushed the radio-space-trigger branch from 94ed0dc to 91066a1 Compare May 28, 2026 05:37

@atomiks atomiks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like a regression from #4053

@atomiks atomiks added type: regression A bug, but worse, it used to behave as expected. component: radio group Changes related to the radio group component. labels May 28, 2026
@atomiks
atomiks merged commit a6b2051 into mui:master May 28, 2026
6 checks passed
@chuganzy
chuganzy deleted the radio-space-trigger branch May 28, 2026 10:59
@atomiks atomiks removed the radio label Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: radio group Changes related to the radio group component. type: regression A bug, but worse, it used to behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants