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: flush validations on submit #173

Merged
merged 1 commit into from
Jul 27, 2020

Conversation

AaronBuxbaum
Copy link
Contributor

No description provided.

@jquense jquense merged commit fca9c63 into jquense:master Jul 27, 2020
@AaronBuxbaum AaronBuxbaum deleted the dont-validate-on-submit branch July 27, 2020 17:36
const handleSubmit = (e?: React.SyntheticEvent) => {
if (e && e.preventDefault) e.preventDefault();
clearPendingValidations();
Copy link
Contributor

Choose a reason for hiding this comment

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

@AaronBuxbaum why do we need to clear pending validations here, if we're going to clear them more-or-less immediately afterward in submit below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jquense suggested adding it in both places in case consumers call submit directly. That said it does seem like it gets resolved with that single usage anyway. I want to check with Jason just in case there's some reason I'm unaware of that we need this line, but it does look like these do end up calling line 442 anyway

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