Repository navigation
Add displayWithCommas: 'always' to NumberInput - #4843
Merged
Merged
Conversation
- 'always' inserts commas while the user types, on desktop and mobile. 'whenBlurred' names the existing behavior, and true remains its alias. - Shared LiveCommas helper reformats the leading integer digits, keeps the caret after the same digit, and steps over a comma on Backspace/Delete. - Desktop passes locale 'en-US' to Blueprint in this mode so arrow-key steps can parse a comma-formatted value. Closes #4794
✅ Unit tests passed - 1,390 tests1,390 tests · 120 spec files · 35 packages · 185.0s · commit 📊 Full report and all tests · interactive HTML report attached to the run |
- skipCommaOnDelete is now a native beforeinput listener keyed on inputType, so it also handles deletes from mobile soft keyboards, which report keydown as 'Unidentified'. - Moved the CHANGELOG entry from 88.1.0 to 90.0.0-SNAPSHOT.
# Conflicts: # CHANGELOG.md # desktop/cmp/input/NumberInput.ts
amcclain
added a commit
to xh/toolbox
that referenced
this pull request
Oct 16, 2026
Companion to xh/hoist-react#4843. - Desktop NumberInput playground: the thousands-separator switch is now a `none` / `whenBlurred` / `always` select. - Mobile inputs page: new NumberInput row with `displayWithCommas: 'always'`. --------- Co-authored-by: Anselm McClain <atm@xh.io>
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.
Closes #4794. Toolbox companion: xh/toolbox#937.
displayWithCommasnow accepts'always'to insert commas while the user types, on desktop and mobile.'whenBlurred'names the existing behavior, andtrueremains its alias.cmp/input/impl/LiveCommashelper, shared by both platforms: groups the leading integer digits and keeps the rest as typed (1,234.,-,1,500k), and restores the caret after each reformat.beforeinputlistener keyed oninputType, so it also works with mobile soft keyboards, which reportkeydownasUnidentified.locale: 'en-US'to Blueprint in this mode, so arrow-key steps can parse a comma-formatted value.Testing: specs cover the helper against a jsdom input. A headless Chrome check confirmed that moving the caret in
beforeinputchanges which character gets deleted. Checked by hand in Toolbox on desktop: caret while typing mid-value, Backspace/Delete at a comma, arrow steps, paste, andmin/max. Still to check: mobile.Known limits: native undo likely breaks after a reformat.