Repository navigation
feat(NumberField): support custom units - #3367
Merged
Merged
Conversation
Contributor
🚀 Preview DeploymentPreview environments are ready:
Images:
|
Lisa18289
force-pushed
the
claude/issue-2579-implementation-1bed35
branch
from
October 2, 2026 06:35
dc318d5 to
24b3347
Compare
Lisa18289
force-pushed
the
claude/issue-2579-implementation-1bed35
branch
2 times, most recently
from
October 2, 2026 07:03
addd71f to
d88d010
Compare
Lisa18289
marked this pull request as ready for review
October 2, 2026 08:58
Lisa18289
force-pushed
the
claude/issue-2579-implementation-1bed35
branch
from
October 6, 2026 05:20
d88d010 to
b7b4091
Compare
mfal
reviewed
Oct 7, 2026
Add a `unit` prop for units Intl.NumberFormat does not support (e.g. MiB,
GiB). React-aria's number parser rejects unknown text in the input value, so
the unit is drawn as an overlay right behind the number and the value stays a
plain number. The input's name references the unit ("Storage MiB"), matching
the current convention of writing such units into the label.
Closes #2579
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lisa18289
force-pushed
the
claude/issue-2579-implementation-1bed35
branch
from
October 8, 2026 12:30
d0e2ab5 to
3a3949e
Compare
Lisa18289
enabled auto-merge
October 8, 2026 12:31
mfal
approved these changes
Oct 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
unitprop toNumberFieldfor unitsIntl.NumberFormatdoes not know, likeMiBorGiB. It renders512 MiBexactly whereformatOptionsunits appear.Until now the fallback was writing the unit into the label ("Storage (MiB)"). The prop is better for sighted users and equal for screen reader users:
Intlunits look the same, so a form mixingGBandMiBfields stays consistent.React-aria's number parser rejects unknown text in the input on every keystroke, which is why #1041 was dropped. So the unit is not part of the input value: an overlay mirrors the input box and an invisible copy of the input text places the unit right behind the number. The value stays a plain number (stepper, validation, form submit unchanged).
For screen readers the unit is attached via
aria-labelledby. As with the label fallback, react-aria's step announcement says only the number ("513"). Unlike the fallback, the stepper buttons keep the label-only name, because react-aria labels them by the label id alone.Closes #2579
🤖 Generated with Claude Code