InputNumber: Bug deprecated KeyCode Usage #5008
Labels
Component: Test
Issue or pull request is related to Component Testing
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
Describe the bug
Bug Summary
The current implementation of the onInputKeyPress method in the InputNumber component of PrimeVue relies on the deprecated keyCode property, which is set to be removed in future browser versions. This poses a potential risk of unsupported behavior as modern libraries and tools may cease to support this deprecated property.
Issue Details
The usage of keyCode is deprecated and marked for removal, causing compatibility issues with modern libraries and testing tools. For instance, the testing library (testing-library/user-event) no longer supports keyCode, as highlighted in this related issue: testing-library/user-event#842. When attempting to test the InputNumber component using this library, the keyCode remains 0, and no event is emitted.
Reproducer
https://codesandbox.io/p/devbox/wizardly-framework-5vw3dy?file=%2Fsrc%2FApp.vue%3A15%2C10
PrimeVue version
3.45.0
Vue version
3.x
Language
TypeScript
Build / Runtime
Vite
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
The text was updated successfully, but these errors were encountered: