base-ui icon indicating copy to clipboard operation
base-ui copied to clipboard

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

Open atomiks opened this issue 6 months ago • 2 comments

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

atomiks avatar May 12 '25 22:05 atomiks

Open in StackBlitz

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

commit: e65cbdd

pkg-pr-new[bot] avatar May 12 '25 22:05 pkg-pr-new[bot]

Deploy Preview for base-ui ready!

Name Link
Latest commit e65cbddac06f7844dbf1d44cbb35ffa29ec00d5d
Latest deploy log https://app.netlify.com/projects/base-ui/deploys/684fad36a2e5fe0008ad2c3f
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.

netlify[bot] avatar May 12 '25 22:05 netlify[bot]

Bundle size report

Total Size Change:${\tiny{\color{red}▲}}$+829B(+0.06%) - Total Gzip Change:${\tiny{\color{red}▲}}$+255B(+0.05%) Files: 41 total (0 added, 0 removed, 2 changed)

@base-ui-components/reactparsed:${\tiny{\color{red}▲}}$+418B(+0.14%) gzip:${\tiny{\color{red}▲}}$+120B(+0.13%) @base-ui-components/react/number-fieldparsed:${\tiny{\color{red}▲}}$+411B(+1.45%) gzip:${\tiny{\color{red}▲}}$+135B(+1.32%)

Details of bundle changes

Generated by :no_entry_sign: dangerJS against e65cbddac06f7844dbf1d44cbb35ffa29ec00d5d

mui-bot avatar Jun 05 '25 05:06 mui-bot