redux-form: Field validation not triggered after reset

Very easy to reproduce:

https://codesandbox.io/s/o22j1lOZB

Modify age, then reset, then modify age, then submit. Field validation on Username and Email are bypassed. UPDATE_SYNC_ERRORS is not triggered after reset like it is when a validated field is dirty.

It looks like the conditions updateSyncErrorsIfNeeded are incorrects.

This is a major issue IMO. I have no easy workaround. @erikras I know you must be terribly busy but can you have a look?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 18 (5 by maintainers)

Most upvoted comments

I confirm, the problem is not solved yet, after the reset, verification is not carried out…

p.s. v6.8.0

Same problem happening here. We have an edit mode and read only mode and have an issue with resetting the form. We have two different behaviors happening Behavior 1 (CORRECT): Enter edit mode, update any form value, leave edit mode (reset() is called). formSyncErrors contains all errors of the wrong fields. Behavior 2 (WRONG): Enter edit mode, don’t update any form value, leave edit mode (reset() is called). formSyncErrors contains no fields, but before reset call it did, so it’s being reset somewhere.

for now we found a workaround: //reset(); initialize(originalData);

This is working, since initialize will trigger the validation UPDATE_SYNC_ERRORS message.

p.s. may require enableReinitialize: true, keepDirtyOnReinitialize: true