-
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
InputNumber: Cannot Type Zero as an Input #6727
InputNumber: Cannot Type Zero as an Input #6727
Comments
I've debugged a little and in the InputNumber OnInputKeyDown function switch statement's default case:
The event.code is checked if it starts with 'Digit', this is problematic because for me when I press zero the event.code = "Backquote", so the condition will fail. In previous builds this wasn't a problem because not the event.code was checked but instead the event.keyCode which should be preferred. Proposed solution:
|
Just read that the keyCode property is deprecated (https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode), so instead I think the best solution is to just omit the |
@fufupati please submit a PR. IT looks like that is what PrimeVue is doing: https://github.com/primefaces/primevue/blob/401dd225677796f05321b0c98ac68b51f3487de6/components/lib/inputnumber/InputNumber.vue#L547C13-L549C14 |
I submitted a PR |
Describe the bug
The InputNumber component doesn't accept 0 as an input regardless from it's properties.
Tested on Hungarian layout keyboard (code page 852).
Reproducer
https://primereact.org/inputnumber
PrimeReact version
10.6.6
React version
18.x
Language
ALL
Build / Runtime
Create React App (CRA)
Browser(s)
Tested on Chrome, Edge, Firefox
Steps to reproduce the behavior
No response
Expected behavior
No response
The text was updated successfully, but these errors were encountered: