React-final-form: Clear validation message after change with submission error

Created on 22 Jun 2019  Â·  2Comments  Â·  Source: final-form/react-final-form

Is there any way to set submission errors temporary? To be clear, I would like to disappear error after field change. My question according to this example https://codesandbox.io/s/9y9om95lyp as you can see occurred error will change only on next form submit – I would like to avoid this case and resolve errors earlier.

Most helpful comment

@SpearThruster
Can you please give some example on how to change submitErrors.
I have situation where my fields unmount and mount again, and all their meta data removes from form state, so I can't rely on dirty, modified, and so on..
Thanks.

All 2 comments

You can change it yourself or you can use the dirtySinceLastSubmit field prop. https://github.com/final-form/final-form/issues/48

Also you can use the setFieldData mutator to mutate the field flag, after an interval.

@SpearThruster
Can you please give some example on how to change submitErrors.
I have situation where my fields unmount and mount again, and all their meta data removes from form state, so I can't rely on dirty, modified, and so on..
Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

antoinerousseau picture antoinerousseau  Â·  3Comments

dawidcxx picture dawidcxx  Â·  4Comments

gsantiago picture gsantiago  Â·  5Comments

mvoloskov picture mvoloskov  Â·  4Comments

czterystaczwarty picture czterystaczwarty  Â·  4Comments