Skip to content
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

number model modifier emits string #4333

Closed
2 of 5 tasks
azamat-sharapov opened this issue Jun 27, 2023 · 2 comments
Closed
2 of 5 tasks

number model modifier emits string #4333

azamat-sharapov opened this issue Jun 27, 2023 · 2 comments
Labels
🐛 bug Unintended behavior

Comments

@azamat-sharapov
Copy link

What happened?

When listening to input event from Field component with model-modifiers="{number: true}", I get string emitted as $event.target.value. I think it should be number instead.

Reproduction steps

No response

Version

Vue.js 3.x and vee-validate 4.x

What browsers are you seeing the problem on?

  • Firefox
  • Chrome
  • Safari
  • Microsoft Edge

Relevant log output

No response

Demo link

https://codepen.io/azamat-sharapov/pen/VwVPoEX

Code of Conduct

@logaretm logaretm added the 🐛 bug Unintended behavior label Jun 28, 2023
@logaretm
Copy link
Owner

This was indeed a bug, but even with the fix you will need to listen for @update:modelValue instead of @input because that will listen to the native HTML input event and not the model event.

The fix will go out with the next release, thanks for reporting this.

@azamat-sharapov
Copy link
Author

@logaretm thanks! Reason I was using @input is because @update:model-value is fired twice on my end. I couldn't reproduce this in codepen though. Using lodash debounce to workaround it until I find real cause. Regarding number model modifier - can confirm that it's working now 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants