vee-validate icon indicating copy to clipboard operation
vee-validate copied to clipboard

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

Open rmnkk opened this issue 2 years ago • 2 comments

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?

  • [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

rmnkk avatar Jun 16 '22 12:06 rmnkk

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.

logaretm avatar Jun 16 '22 20:06 logaretm

Looks like the problem with parseFloat

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

notiv-nt avatar Jul 18 '22 19:07 notiv-nt