Open marrkeri opened 5 years ago
In this link I have been fighting with with onSubmit on <form>
so at least for now it will help to others https://stackoverflow.com/questions/58560978/form-onsubmit-handlesubmit-is-triggered-through-any-button-which-has-type-sub/58561557#58561557
Check this demo: https://codesandbox.io/s/react-final-form-focus-on-first-error-ib23b
If you avoid
<form>
tag and you use just<button onClick={form.submit} disabled={submitting}>Submit</button>
, validation is provided but focus is not there.Problem with
<form onSubmit={handleSubmit} />
is that, that even Enter on textbox will trigger it or even worse every other button without specifying type="". It would be also helpful to have it without<form>
tag