-
Notifications
You must be signed in to change notification settings - Fork 13
Description
The InputNumber component from the FormKit-PrimeVue integration does not update the data properly when input is modified. Although the formatted value is displayed correctly, the reactive data model does not reflect changes, leaving the value unchanged after input events.
Steps to Reproduce:
- Go to the demo page: https://formkit-primevue.netlify.app/inputs/inputNumber
- Modify the InputNumber value in the form.
- Observe that the data model does not update as expected.
Expected Behavior:
The data model should be updated in real-time when the user inputs a value.
Actual Behavior:
While the number is formatted and displayed correctly, the reactive model is not updated, and the original value remains unchanged.
Possible Cause:
In the current implementation, the handleInput function uses context?._value, which does not correctly reflect the new input value. Changing this line in useFormKitInput to use _.value seems to resolve the issue:
function handleInput(_: any) {
// context?.node.input(context?._value) // This is the original line
context?.node.input(_.value) // This is the modified line
}Additional Context:
I might be missing something here, as there could be a reason why context?._value is used instead of the direct value. It works fine in other components but not with InputNumber, so the issue might be more complex.
Just wanted to point this out and congratulate you on this fantastic repository!