Skip to content

closes #434, #408 - added $event to onValidationError #443

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

Merged

Conversation

zoul0813
Copy link
Member

added $event to onValidationError and call preventDefault when onValidateBeforeSubmit is true

We can't prevent the submit after waiting for async validation, so we just prevent it before calling any validation and let the user
manually submit the form in the onSubmit handler, if it validates.

  • 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, feature, docs update, ...)
    Bug Fix
  • What is the current behavior? (You can also link to an open issue here)
    <form /> are submitted when using submit field with validateBeforeSubmit.
  • What is the new behavior (if this is a feature change)?
    validateBeforeSubmit: true calls $event.preventDefault() and prevents the form submission
  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
    This PR should introduce "expected behavior", so users should not need to do anything.
  • Other information:

…idationError and call preventDefault when onValidateBeforeSubmit is true

We can't prevent the submit after waiting for async validation, so we just prevent it before calling any validation and let the user
manually submit the form in the `onSubmit` handler, if it validates.
@zoul0813
Copy link
Member Author

@icebob I'm going to merge this in later today as no one else has reviewed it. OK?

Also - if I bump the version that will automatically do an npmjs update?

@icebob
Copy link
Member

icebob commented Apr 24, 2018

OK.

Yes, but you have to use npm run version .... script. More info: #246 (comment)

@zoul0813
Copy link
Member Author

@icebob yes, I'm going to do that a separate PR with the version bump and include refs to the issues included in it. Thanks.

@zoul0813 zoul0813 merged commit 73a08c1 into vue-generators:master Apr 24, 2018
@zoul0813 zoul0813 deleted the feature/434-validateBeforeSubmit branch April 24, 2018 19:59
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.

2 participants