We have a website with several autoforms on different pages / routes. If a user launches verification in a specific form and causes some verification errors, and then leaves a page with this form, when they return to this page later, the data they entered disappears, but all verification errors remain (fields are highlighted and verification error messages )
How can we reset check the form when the user leaves the form page?
I know that we can use AutoForm.resetForm('our-form-id')to reset, and this works in the console, but I can not find a suitable hook to hang it. The onStopIronRouter hook for the page will be the right place, but this causes an error. Can't call Tracker.flush while flushing.If I wrap it in setTimeoutwith a timeout of 0, so it will not work until the next tick, this (presumably this template is destroyed by this point).
I would think that when the template is destroyed, the error state will also be, but it is not there. Is there an undocumented way to "hard" reset errors even if the active template no longer exists?
We are using AutoForm 4.2.2.
source
share