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

Form doesn't wait for pending validations before submitting.

Open
#177 5 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

I've found something that looks like a bug.

I don't think it should be possible to submit a form until validations have passed, however if validation is in progress a form still submits as if the validation had passed..

The following example is just like the Async validation example but with a longer delay inside the validator. Filling in the form with an invalid name and immediately submitting allows the form to be submitted with invalid content.

https://codesandbox.io/s/8n1n7zy1rj

I believe form submission should wait for validation to complete. Furthermore ensuring appropriate timeouts so that a form isn't locked by a never ending validation should be the concern of the validation function.

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.