-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
input type="number" should not need an extra attribute “number” #1713
Comments
👍 This bit me the other day; took me 45 minutes to figure out what was going on. |
Sounds like "magic", maybe just warning would be helpful then? |
@azamat-sharapov I'm not entirely sure what about it seems "magical". I expect Thinking about it another way, I have already said, "This is a number" by declaring |
@Morgul turns out |
@yyx990803 Ah, I wasn't aware of that; haven't actually worked with raw input fields in a very long time. Still, it feels like this is an obvious feature for |
I was calling auto-casting as "magical", because as Evan also said - it's all string. It's HTML to blame. So, if you want enhancement to standard HTML, just add Vue's |
I think |
@yyx990803 Would you be open to an alternative syntax? <!-- Cast to number -->
<input type="number" v-model.number="foo">
<!-- Cast to boolean -->
<input type="text" v-model.boolean="bar"> This feels more in keeping with v1.0's syntax. |
@Morgul That sounds like a good idea! You should open a separate issue. |
@yyx990803 Evan please see #5731 regarding a simular issue/workaround which does not involve autocasting, but instead splicing the attribute when its a number and empty.... |
Just in case someone else stumbles across this, this is now addressed per @Morgul suggestion and documented here: Form Input Bindings/Modifiers/ |
Thanks for the update @zero298 , I just stumbled across this. And thanks everyone for the good work |
Browser's behavior is that a numeric input has an additional property |
It should be great if we could write
in place of
What do you think?
The text was updated successfully, but these errors were encountered: