formio.js
formio.js copied to clipboard
[BUG] Reset form after submit does not set the form to pristine state
Describe the bug
When a form is submitted with valid data, we are trying to reset the form using different ways like 1. form.resetValue(); form.redraw(); 2. form.submission = {}; form.resetValue(); form.refresh(); but none of them re working consistently. Sometimes they work and sometimes they do not work.
We are facing this issue since we upgraded formio SDK to "@formio/js": "^5.0.0"
Version/Branch
"@formio/js": "^5.0.0"
To Reproduce Steps to reproduce the behavior:
- Create form.
- Submit the form.
- Clear the form post submit using one of the following ways. The values are cleared but form still not set to pristine state and sowing errors.
form.submission = {};form.resetValue();form.resetValue(); form.refresh();form.submission = {}; form.resetValue(); form.refresh();
Expected behavior When the form is reset it is expected to look the same way as it was initially loaded.
Can you provide a jsfiddle to help triage?