react-currency-input-field
react-currency-input-field copied to clipboard
FixedDecimalLength prop + onBlur changes intended input value
Describe the bug
If the prop fixedDecimalLength
is set, when onBlur
is triggered, numbers such as 200
will change to 2.00
123
» 1.23
350
» 3.50
etc
To Reproduce Steps to reproduce the behavior:
- Go to forked sandbox
- remove the default value
- Enter
200
- click in the whitespace to trigger
onBlur
Expected behavior
The input value of 200
would change to 200.00
Code Sandbox
Additional context I see that there are tests to actually show this is intended behavior (?!)
So I guess I should just fork this repo, or will this request be addressed?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
bump
Bump?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
For people like me having the same issue (123 becomes 1.23) and arriving here:
Instead of using fixedDecimalLength
, you just need to use decimalScale
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.