We have a form and have the submit button hooked up to the errors from onChange as described in the docs. However, if you type and hit enter in a form, you can trigger the form submit before the onChange callback is invoked with the new data and results. This means, if the form data was already valid, and the user updates then hits enter, it will submit the stale data.
Is there any way to detect if the form is currently being updated and a validation is in progress? If I could at least know that there is a validation happening and I should wait for it to finish to submit then I wouldn’t be able to submit stale data. I’m surprised this hasn’t come up before, because it seems like a pretty big race condition, I was easily able to type and hit enter and beat the onChange callback.