Skip to content

[number field] Ensure onValueChange is called with already-formatted parsed value #1905

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

atomiks
Copy link
Contributor

@atomiks atomiks commented May 12, 2025

Fixes #1817

  • Uses maximumFractionDigits: 20 when checking to ensure full precision
  • Values coming externally have their precision respected as priority until changed via the event handlers, at which point the formatting is respected

Preview: https://codesandbox.io/p/sandbox/base-ui-number-input-blurring-2-forked-crsnw2?file=%2Fsrc%2FApp.tsx

Copy link

pkg-pr-new bot commented May 12, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@base-ui-components/react@1905

commit: 2778625

Copy link

netlify bot commented May 12, 2025

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 2778625
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/68270dd29a5a1200089f1526
😎 Deploy Preview https://deploy-preview-1905--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@atomiks atomiks force-pushed the fix/number-field-format-precision branch 2 times, most recently from 7a16103 to fa25e8b Compare May 12, 2025 22:36
@atomiks atomiks force-pushed the fix/number-field-format-precision branch 4 times, most recently from 355e153 to 5ca9fc8 Compare May 12, 2025 23:42
@atomiks atomiks marked this pull request as ready for review May 12, 2025 23:50
@atomiks atomiks force-pushed the fix/number-field-format-precision branch 2 times, most recently from 191bfc2 to 8ae4e9a Compare May 12, 2025 23:54
@atomiks atomiks force-pushed the fix/number-field-format-precision branch from 8ae4e9a to 7c2539c Compare May 14, 2025 01:54
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label May 16, 2025
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[number field] refocusing and blurring input can cause value to change
1 participant