formio.js icon indicating copy to clipboard operation
formio.js copied to clipboard

[BUG] Reset form after submit does not set the form to pristine state

Open dheepak-aot opened this issue 10 months ago • 1 comments

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:

  1. Create form.
  2. Submit the form.
  3. 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.
  1. form.submission = {};
  2. form.resetValue();
  3. form.resetValue(); form.refresh();
  4. form.submission = {}; form.resetValue(); form.refresh();

Image

Image

Expected behavior When the form is reset it is expected to look the same way as it was initially loaded.

dheepak-aot avatar Feb 14 '25 00:02 dheepak-aot

Can you provide a jsfiddle to help triage?

lane-formio avatar Mar 28 '25 20:03 lane-formio