Skip to content

[number field]: Fix readonly stepper semantics - #5047

Closed
lyzno1 wants to merge 3 commits into
mui:masterfrom
lyzno1:codex/fix-number-field-readonly-steppers
Closed

lyzno1 wants to merge 3 commits into
mui:masterfrom
lyzno1:codex/fix-number-field-readonly-steppers

Conversation

@lyzno1

@lyzno1 lyzno1 commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Remove invalid aria-readonly from NumberField increment and decrement buttons.

aria-readonly is only valid on value-oriented roles such as spinbutton and textbox; it is not supported on the button role (WAI-ARIA spec, button role). The readonly state should be exposed by the value control, not by the stepper command buttons.

Fix

Keep the readonly state on NumberField.Input, remove aria-readonly from the stepper button props, and route readonly steppers through the existing button disabled semantics so they are exposed as unavailable while preserving data-readonly for styling.

@pkg-pr-new

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

commit: a22ff32

@code-infra-dashboard

code-infra-dashboard Bot commented Jun 15, 2026 •

Copy link
Copy Markdown

Bundle size

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

Details of bundle changes

Performance

Total duration: 1,399.60 ms 🔺+269.81 ms(+23.9%) | Renders: 50 (+0) | Paint: 2,101.75 ms 🔺+402.33 ms(+23.7%)

Test Duration Renders
Tabs mount (200 instances) 268.88 ms 🔺+50.42 ms(+23.1%) 4 (+0)
Menu mount (300 instances) 167.15 ms 🔺+48.71 ms(+41.1%) 2 (+0)
Select mount (200 instances) 171.15 ms 🔺+36.02 ms(+26.7%) 3 (+0)
Mixed surface mount (app-like density) 95.25 ms 🔺+30.15 ms(+46.3%) 5 (+0)
Scroll Area mount (300 instances) 112.99 ms 🔺+25.05 ms(+28.5%) 3 (+0)

…and 4 more (+3 within noise) — details


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

@netlify

netlify Bot commented Jun 15, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Built without sensitive environment variables

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

@lyzno1 lyzno1 changed the title fix(number-field): fix readonly stepper semantics [number-field]: fix readonly stepper semantics Jun 15, 2026
@lyzno1 lyzno1 changed the title [number-field]: fix readonly stepper semantics [number-field]: Fix readonly stepper semantics Jun 15, 2026
@lyzno1
lyzno1 marked this pull request as ready for review June 15, 2026 08:03
@lyzno1 lyzno1 changed the title [number-field]: Fix readonly stepper semantics [number field]: Fix readonly stepper semantics Jun 15, 2026
@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Jun 15, 2026
…eld-readonly-steppers

# Conflicts:
#	packages/react/src/number-field/decrement/NumberFieldDecrement.tsx
#	packages/react/src/number-field/increment/NumberFieldIncrement.tsx
@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Jun 15, 2026
@atomiks

atomiks commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Folding this into #5046, which now removes aria-readonly from the stepper buttons and routes read-only steppers through the existing button disabled semantics (same change as here, plus a regression test in NumberFieldRoot.test.tsx). Closing in favor of that PR.

@atomiks atomiks closed this Jun 15, 2026
@zannager zannager added the component: number field Changes related to the number field component. label Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: number field Changes related to the number field component.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants