primevue
primevue copied to clipboard
fix/InputNumber Fixes #7562 (change to initial value when delete last…
There was a bug related to the InputNumber field in PrimeVue where, when attempting to delete the entire value using backspace, the field would revert back to its initial value. This issue is also reported in the official repository and can be referenced here: #7562
The problem originates from the formDefaultValue watcher inside the BaseEditableHolder file, where newValue is directly assigned to d_value. This causes the initial value to be automatically rewritten into the input field right after the last character is deleted.
To resolve this issue, I’ve modified the watcher so that d_value is updated with newValue only if the form has not yet been initialized, d_value is not null/undefined/empty, and d_value !== newValue. With this change, the issue no longer occurs.
Since this bug significantly affects our usage in our project, we would greatly appreciate it if this fix could be included in the upcoming Milestone 4.3.5.
@tugcekucukoglu
Hi 👋
Thanks for the fix — this issue is currently blocking us in production. Do you have any idea when this PR might be merged or included in a release?
Appreciate the great work from the team 🙏
Our entire production setup is also waiting for this merge. :) @mertsincan