-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Milestone
Description
Expected: On change of an input, validations are run and the form is submitted (if no validations failed)
Actual: On change of an input, validations are run against the previous values and the form does not submit
Sandbox: https://codesandbox.io/s/redux-form-synchronous-validation-forked-uborp?file=/SyncValidationForm.js (type a single letter into the username input)
Related redux-form issues: redux-form/redux-form#537, redux-form/redux-form#4177
Suggested solution: Wrap props.submit() in a timeout to ensure that the form has the latest values
Workaround: Instead of passing submitOnChange: true to lpForm, we can override the change handler like so
onChange: (_values, _dispatch, props) => {
setTimeout(props.submit, 0)
},dpikt