logaretm / vee-validate

✅ Painless Vue forms
https://vee-validate.logaretm.com/v4
MIT License
10.79k stars 1.26k forks source link

[v3] Issue when using .number for v-model #3804

Closed rmnkk closed 4 months ago

rmnkk commented 2 years ago

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

  1. Add .number modifier for v-model inside input
  2. Try to input the value as 0.01
  3. 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?

Relevant log output

No response

Demo link

https://codesandbox.io/s/confident-edison-0eoh1x?file=/src/App.vue

Code of Conduct

logaretm commented 2 years ago

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.

notiv-nt commented 2 years ago

Looks like the problem with parseFloat

https://github.com/logaretm/vee-validate/blob/fee05f7ac8188cdef27a96ea2e7a53f24e18b73d/src/utils/events.ts#L36-L44