Skip to content

[number field] Sync pasted input during step interactions - #4824

Merged
atomiks merged 1 commit into
mui:masterfrom
lunaxislu:number-field-paste-step-sync
May 15, 2026
Merged

atomiks merged 1 commit into
mui:masterfrom
lunaxislu:number-field-paste-step-sync

Conversation

@lunaxislu

Copy link
Copy Markdown
Contributor

Fixes #4823.

Problem

After pasting into an uncontrolled NumberField, wheel and scrub interactions could update the numeric value while leaving the visible input text unchanged.

Cause

Pasting intentionally disables input syncing so raw user text is preserved until blur. Keyboard and increment/decrement button step interactions already restore input syncing before applying a stepped value, but wheel and scrub did not.

Fix

Restore input syncing at the wheel and scrub interaction boundaries before applying the stepped value. This keeps direct text editing behavior intact while aligning wheel/scrub with the other step-based interactions.

Verification

  • pnpm test:jsdom NumberField --no-watch
  • pnpm test:chromium NumberField --no-watch
  • pnpm prettier
  • pnpm typescript
  • pnpm stylelint

@pkg-pr-new

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

commit: 97e1b99

@lunaxislu lunaxislu changed the title [number-field] Sync pasted input during step interactions [number field] Sync pasted input during step interactions May 14, 2026
@lunaxislu
lunaxislu marked this pull request as ready for review May 14, 2026 16:27
@code-infra-dashboard

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

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react 🔺+51B(+0.01%) 🔺+18B(+0.01%)

Details of bundle changes

Performance

Total duration: 1,105.88 ms -93.63 ms(-7.8%) | Renders: 50 (+0) | Paint: 1,701.81 ms -149.66 ms(-8.1%)

No significant changes.


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

@netlify

netlify Bot commented May 14, 2026

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Built without sensitive environment variables

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

@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.

Thanks for the fix @lunaxislu

@atomiks atomiks added component: number field Changes related to the number field component. type: bug It doesn't behave as expected. labels May 15, 2026
@atomiks
atomiks merged commit 453ec88 into mui:master May 15, 2026
6 of 7 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Aug 12, 2026
5 tasks done
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. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[number field] Pasted input does not visually sync during wheel or scrub interactions

2 participants