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

eager mode doesn't work with v-model.number #2403

Closed
shahafss opened this issue Oct 6, 2019 · 2 comments · Fixed by #2408
Closed

eager mode doesn't work with v-model.number #2403

shahafss opened this issue Oct 6, 2019 · 2 comments · Fixed by #2408
Labels
🐛 bug Unintended behavior

Comments

@shahafss
Copy link

shahafss commented Oct 6, 2019

Versions

  • vee-validate: 3.0.10
  • nuxt: 2.9.2

Describe the bug
When using v-model.number, eager mode doesn't work.

To reproduce
Steps to reproduce the behavior:

  1. define an input with v-model.number
  2. make the input valid
  3. make it invalid
  4. See invalid state immediately

Expected behavior
It should work as with the default v-model

@logaretm
Copy link
Owner

logaretm commented Oct 6, 2019

Could you setup a sample on codesandbox? thanks!

@logaretm logaretm added the 🤔 needs reproduction This issue requires a demo label Oct 6, 2019
@shahafss
Copy link
Author

shahafss commented Oct 7, 2019

@logaretm here:
https://codesandbox.io/s/v-validate-v-modelnumber-eager-s7uiu

Once you remove the default 0 and replace it with 1 > leave the field > see error > replace value with 2 > change back to 1 > error is visible.

Thanks

@logaretm logaretm added 🐛 bug Unintended behavior and removed 🤔 needs reproduction This issue requires a demo labels Oct 7, 2019
logaretm added a commit that referenced this issue Oct 8, 2019
* fix: cast values to numbers before commiting them closes #2403

* fix: trim values before commiting them when v-model.trim is used

* test: added modifier tests

* test: added case for NaN with v-model.number
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

Successfully merging a pull request may close this issue.

2 participants