Pass document to form.reset() to avoid resetting it to pre-submission values

This commit is contained in:
SachaG 2018-06-21 10:29:00 +09:00
parent b4ac2d23af
commit 973b2bfce3

View file

@ -635,7 +635,7 @@ class SmartForm extends Component {
// call the clear form method (i.e. trigger setState) only if the form has not been unmounted
// (we are in an async callback, everything can happen!)
if (typeof this.refs.form !== 'undefined') {
this.refs.form.formsyForm.reset();
this.refs.form.reset(this.getDocument());
this.clearForm({ clearErrors: true, clearCurrentValues: true, clearDeletedValues: true, document });
}