feat(ramp): improve amount editing formatting #11613
Open
+40
−5
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.
Description
This PR improves the changes introduced in #9039, which formatted the amount input on-the-fly as the user typed it for better readability (
123456.78
to123,456.78
). However the formatting was introducing an unexpected state when the user typed the decimal separator (See Before video).This PR brings back the full formatting when the user has finishing editing the amount. While editing, the amount will be grouped in 3 chars separated by space to improve readability of the input.
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
When decimal separator is typed, the amount remains unchanged.
When deleting the decimal separator, the amount remains unchanged.
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-10-03.at.14.10.18.mp4
After
The amount represents every state of the amount change, even partial ones lile
1234.
or1234.0
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-10-03.at.14.08.39.mp4
Pre-merge author checklist
Pre-merge reviewer checklist