-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It is impossible to type fractional digits on InputNumber #1380
Comments
Same problem. |
This is probably caused by the desire to guarantee a value of a number type only. But this goal seems impossible. If the user typed in "123," - that's a string. You can't convert it to a number without losing information that the user intends to type a fraction part. If the component would keep an internal string buffer that comes with its own problems too. Yes, instead of a string buffer you can e.g. keep some sort of "user started a fraction" boolean - makes no difference. Internal hidden state WILL get stale, out of sync, there is just no way around it. You need to expose it. So IMHO...
|
Same problem (immediately coercing to valid number value on each keypress) makes it hard to input values if you have something like min={10} max={200} set. A lot of invalid intermediate states. |
Same problem. Needs some improvements over typing experience. It's nearly impossible to enter the desired decimal number. |
Why this is an enhancement? It is clearly a bug. |
Hi, Thanks a lot for all feedbacks! On 5.0, the decimal separator can be typed in inputNumber. In addition, some enhancements were made according to the feedbacks received in this component.
Thanks again! |
I'm on version 5.0.0-rc.1 and I still can't put a decimal separator in InputNumber |
@mertsincan Unfortunately I still cannot type decimal separators in the examples here and I cannot delete them. |
Continued in #1768. |
Here is my 8.0.0 sandbox of this can someone try and replicate the issue again please. See: https://codesandbox.io/s/primereact-test-forked-fd0ukd?file=/src/index.js |
There is no guarantee in receiving an immediate response in GitHub Issue Tracker, If you'd like to secure our response, you may consider PrimeReact PRO Support where support is provided within 4 business hours
I'm submitting a ... (check one with "x")
Codesandbox Case (Bug Reports)
https://codesandbox.io/s/inputnumberbug-5shee
Current behavior
It is impossible to type the fractional part of a number (decimals or cents) because it is not possible to type commas or dots.
Expected behavior
Be able to type the fractional part of a number (decimals or cents) of a number.
Minimal reproduction of the problem with instructions
In the codesandbox above or in the PrimeReact InputNumber showcase, try to input a value with fractional digits, e.g 1500.50.
You will see it's not possible to type the dot or comma, so it is impossible to type the fractional part of a number.
Please tell us about your environment:
OS: Ubuntu 18.04
Node version: v12.16.1
NPM version: 6.13.4
React version: ^16.13.1
PrimeReact version: ^4.2.1
Browser: Chrome 83.0.4103.61 but I think it will happen in any other browser
Language: TypeScript 3.9.3 and JS
Observation
This situation occurs too in the PrimeVue InputNumber component.
The text was updated successfully, but these errors were encountered: