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

Core: Don't call submitHandler when in debug mode #2193

Merged
merged 1 commit into from
Jul 29, 2018

Conversation

Arkni
Copy link
Member

@Arkni Arkni commented Jul 29, 2018

Fixes #2042

@Arkni Arkni mentioned this pull request Jul 29, 2018
src/core.js Outdated
@@ -64,7 +65,8 @@ $.extend( $.fn, {
.appendTo( validator.currentForm );
}

if ( validator.settings.submitHandler ) {
// Only call the submit handler in case the validator is not on debug mode
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment does not provide value.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to write a console.log in debug mode instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, you're right! It doesn't have any additional value. I don't know why I wrote that comment in the first place (it was around 2AM when I created this PR). Will remove it in a moment.

As for the console.log, it will not make sense to print that the submitHandler will not be called when it supposed to not be called in the first place. So, we will just let it that way.

@Arkni Arkni merged commit 2037129 into jquery-validation:master Jul 29, 2018
@Arkni
Copy link
Member Author

Arkni commented Jul 29, 2018

Thanks for the review @staabm :)

@Arkni Arkni deleted the submithandler-issue-2042 branch July 29, 2018 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants