final-form / final-form/react-final-form

handleSubmit throws error if field validations fails

Open
#773 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.4k
Forks
497
PR merge metrics
No merged PRs in 30d

Description

### Are you submitting a **bug report** or a **feature request**?
I am submitting an issue; while I am using a promise for resetting the fields on submit, if there is no field validation error and I submit the form; its working fine; but if I submit the form while validation error exists, it throws the error of .then is undefined. I am using Promise to reset the form fields once form submitted successfully.

I tried to search in your examples form but didn't find any example where its a validation + form resetting.

### What is the current behavior?

https://codesandbox.io/s/react-final-form-reset-validation-jbpcc
### What is the expected behavior?
Ideally, it should not go to the submit form until all the validation error is not solved.
### Sandbox Link

### What's your environment?

### Other information

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.