Reputation: 21
onSubmitFail does not seem to exist in react-final-form, is there an equivalent or a work around?
In redux-form you could pass an onSubmitFail fail prop
AfterCheckoutForm = reduxForm({
form: formName,
destroyOnUnmount: false,
onSubmitFail: errors => {
scrollToErrors();
}
})(AfterCheckoutForm);
Upvotes: 1
Views: 564
Reputation: 7272
No, but there is a solution specifically tailored to scroll to errors. 😄
Check out final-form-focus
.
Upvotes: 1