react-number-format
react-number-format copied to clipboard
Issue with decimalScale=0 and pressing .-key
When using decimalScale=0
the component deletes all following numbers when pressing the .
(or decimalSeparator
key).
<NumberFormat
decimalScale={0}
decimalSeparator=","
thousandsSeparator="."
/>
Steps to reproduce:
- The input contains the following number:
12345
- Place the cursor between
3
and4
- Press
.
or,
(=decimalSeparator
)
Now everything behind the cursor (= 45
) will get deleted. The new value within the input is 123
.
I don't think this is nice behavior. Or is this intended?
I also encountered the same problem. Is it a bug? Is there another way to prevent decimal input, guys?