Unable to reset form with localstorage plugin
Reproduction
https://formkit.link/240690ce7705f58fecdbd2caa8701ad2
Describe the bug
Hello, when you try to reset the form with the localstorage plugin the file object remains even if you completely delete localstorage. So after you submit the form it remains in localstorage and is not deleted.
Environment
• OS: [Windows 10] • Browser [firefox] • Version [1.4.0]
I’m not seeing this behavior. Can you perhaps give a step-by-step procedure to reproduce it?
Here we fill the form and we see it in localstorage.
After you submit the form, localstorage remain.
I see what you’re saying. I guess I would have a different expectation than you about what should happen here. In my view, the form should reset to it’s initial state which includes the file property{ file: [] }) since the the file input type should always be set to an array even when empty, and the local storage should always be a reflection of that precise state, even if that state is empty.
I think your expectation is that when a form is "empty" there is no local storage at all, is that correct?
If so then the primary question becomes how we determine what the "initial" or "empty" state of the form is. This is complicated by the fact that some inputs provide initial values, such as the file input or multiple checkboxes. Knowing what an "empty" form is becomes rather complex.
Is there any deleterious effect from the local storage existing when the form is in an empty state?
Closing — please feel free to re-open if there's an argument against the current behavior.