Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Param attribute "number" set 0 as default #3577

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

Closed
AnthonySendra opened this issue Aug 31, 2016 · 6 comments
Closed

Param attribute "number" set 0 as default #3577

AnthonySendra opened this issue Aug 31, 2016 · 6 comments

Comments

@AnthonySendra
Copy link

Vue.js version

1.0.26

Reproduction Link

https://jsfiddle.net/59Lh3310/

Steps to reproduce

  • Click on the input
  • Click somewhere else

What is Expected?

Empty input

What is actually happening?

The value is set to 0 (even if the default value is set to null) because of Param Attributes Number (http://vuejs.org/guide/forms.html#number)

@LinusBorg
Copy link
Member

Same problem as #3541, but for 1.0

@zcoding
Copy link

zcoding commented Sep 1, 2016

The v-model directive will reset the input's value on blur, and if you give a number param, it will always change the value to Number.
See here.

@Buwder
Copy link

Buwder commented Nov 2, 2016

The v-model directive will reset the input's value on blur, and if you give a number param, it will always change the value to Number.
See here.

@LinusBorg
Copy link
Member

@Buwder you simply copied the comment above yours. Are you going to add anything of your own or can I delete your comment?

@defcc
Copy link
Member

defcc commented Nov 2, 2016

@LinusBorg this issue seems to be fixed in 2.0 ?
https://github.com/vuejs/vue/blob/dev/src/shared/util.js#L18

@LinusBorg
Copy link
Member

LinusBorg commented Nov 2, 2016

That may be the case(can't verify now) but this issue is tagged as 1.0... :-P

yyx990803 pushed a commit that referenced this issue Nov 4, 2016
* 	empty string should not be casted to 0. Backport it from vue2

* trim whitespace

* fix coding style

* fix coding style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants