Skip to content

Data in primeInputNumber not updating on input #53

@ArnarArnar

Description

@ArnarArnar

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:

  1. Go to the demo page: https://formkit-primevue.netlify.app/inputs/inputNumber
  2. Modify the InputNumber value in the form.
  3. 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions