You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are you submitting a bug report or a feature request?
This is a feature request and I'm willing to provide a PR.
What is the current behavior?
When submitting a form, e. g. by writing into an input field and triggering enter, validation is not triggered. With validateOnBlur, this means that the field is never validated before submission.
Submission is blocked, though, if there are already errors in the form state. This means that when I have a form with errors, fix the errors and submit by pressing enter, then the submission will fail as validation did not run again.
This cannot be fixed outside the library, as the onSubmit and beforeSubmit hooks would only get called afterhasSyncErrors already cancelled the execution.
What is the expected behavior?
Introduce a config flag validateOnSubmit that, if set, runs validation instead of calling hasSyncErrors in submit.
Are you submitting a bug report or a feature request?
This is a feature request and I'm willing to provide a PR.
What is the current behavior?
When submitting a form, e. g. by writing into an input field and triggering enter, validation is not triggered. With
validateOnBlur
, this means that the field is never validated before submission.Submission is blocked, though, if there are already errors in the form state. This means that when I have a form with errors, fix the errors and submit by pressing enter, then the submission will fail as validation did not run again.
This cannot be fixed outside the library, as the
onSubmit
andbeforeSubmit
hooks would only get called afterhasSyncErrors
already cancelled the execution.What is the expected behavior?
Introduce a config flag
validateOnSubmit
that, if set, runs validation instead of callinghasSyncErrors
insubmit
.Sandbox Link
https://codesandbox.io/s/react-final-form-simple-example-forked-pgdml?file=/index.js
What's your environment?
Tested with react-final-form
6.5.2
and final-form4.20.1
.Other information
Happy to contribute a PR if this feature is of interest.
Other related issues:
The text was updated successfully, but these errors were encountered: