-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Behavior change v-model on input type number cast value to number by defualt #5284
Comments
@lidlanca But i think that the cast not need to be by default is different behavior Also the documented in not clear "Vue can automatically convert..." mybe "Vue automatically try to convert..." |
perhaps vue should not have casted by default, keep this issue open, see what core team has to say. feel free to suggest improvement to the docs if you find the current phrasing confusing also note that the docs will soon be updated to this, which I find even more misleading. |
This was working properly in earlier 3.x versions but then the breaking change was introduced (#3813, https://github.com/vuejs/core/blob/main/CHANGELOG.md#320-beta2-2021-07-19) |
I was also affected by this change. Until now, the length of the string was used to detect that the input filed was empty. |
Version
3.2.26
Reproduction link
jsfiddle.net/8vqaotbx/1/
Steps to reproduce
create input element type number
the value cast to number type
On Vue version 2 it not do it by defualt , it is big chage i have big project that expected the value return is string
What is expected?
Mybe can add to core modifier numeric that not cast the value to number.
Or add flag that Vue not do it by defualt
What is actually happening?
v-model cast value of input number to number type
core/packages/runtime-dom/src/directives/vModel.ts
Line 52 in 9c304bf
The text was updated successfully, but these errors were encountered: