-
-
Notifications
You must be signed in to change notification settings - Fork 462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clear errors on form reset #1568
Conversation
The Svelte version of the useForm helper actually has a few bugs in it. I believe it boils down to trying to directly read values in a Svelte store using Look on line 68 of the From my understanding of Svelte stores, in JS you can’t directly acccess the value. You need to subscribe to the store. |
@weavdale hey thanks for this feedback? I use Vue and React on a regular basis, but I don't use Svelte often, so that's probably why I've got things wrong here 😅 Are you able to submit a PR to correct these issues? 🙏 |
3edcae8
to
97821e6
Compare
5cd32e1
to
3e08b36
Compare
This reverts commit 74d682c.
Right now when using the form helper, calling
form.reset()
does not clear the form errors. This feels like a bug, since if you're resetting the form to its initial state you likely also want the errors to be cleared out.This PR updates the form helper to clear form errors when resetting the form:
If you're only resetting certain fields, only those corresponding errors will be cleared: