vee-validate
vee-validate copied to clipboard
[v3] Issue when using .number for v-model
What happened?
I'm not sure how it is happening. I have custom input that looks like that When using the .number modifier on the v-model I couldn't input 0 after dot or comma, to get a value like that: 0.01 or just 0.00
Reproduction steps
- Add .number modifier for v-model inside input
- Try to input the value as 0.01
- Inputting 0 after . will remove 0 and only 0 would be shown
Version
Vue.js 2.x and vee-validate 3.x
What browsers are you seeing the problem on?
- [X] Firefox
- [X] Chrome
- [x] Safari
- [X] Microsoft Edge
Relevant log output
No response
Demo link
https://codesandbox.io/s/confident-edison-0eoh1x?file=/src/App.vue
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
This is indeed a bug.
I stopped working on v3 for a while now. So this won't get fixed unless someone is interested in tackling it.
Looks like the problem with parseFloat
https://github.com/logaretm/vee-validate/blob/fee05f7ac8188cdef27a96ea2e7a53f24e18b73d/src/utils/events.ts#L36-L44