Skip to content
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

Fix required number input does not require a value #538

Merged
merged 1 commit into from
Dec 14, 2018

Conversation

pacopage
Copy link
Contributor

  • Please check if the PR fulfills these requirements
  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • What kind of change does this PR introduce?
    Bug fix.
    When using a input of type number that should be required, you actually do not get a validation error.
    Instead value in model is set to null.
  • What is the current behavior? (You can also link to an open issue here)
    see https://jsfiddle.net/j04uhscq/17/
    => age field is required but not setting it does not lead to a validation error
  • What is the new behavior (if this is a feature change)?
  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
  • Other information:
    Root cause for issue was that a null input becomes a NaN.
    Lodash's isNumber (used in number validator) returns true for that, so replaced it by isFinite

@coveralls
Copy link

Coverage Status

Coverage remained the same at 89.916% when pulling f95b38c on pacopage:master into d69e0af on vue-generators:master.

@zoul0813 zoul0813 merged commit b15112b into vue-generators:master Dec 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants