form.reset(): Add easy way to re-validate fields and reset metadata on reset #2049
Unanswered
willmruzek
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Initial Discord post: https://discord.com/channels/719702312431386674/1474015671841984614
Context / need
My main use-case: canSubmit returns to
falseafter form.reset()Details
In building a form with a reset button, I noticed that fields aren't re-validated and isTouched/isBlurred is not reset.
In my case, I wanted
resetto make the form like it had never been touched.The ultimate goal was to re-disable the submit button after reseting the form.
Arguably, the desire to re-validate and reset meta state when calling
form.reset()will vary based on requirements.Right now, all of this needs to be done manually.
Proposal
form.reset()form.reset()Just an idea
Beta Was this translation helpful? Give feedback.
All reactions