T
TanStack12mo ago
quickest-silver

canSubmit not resetting when using form.Subscribe when form inputs are invalid

When I click the submit button on my form using form.Subscribe when the fields are all empty, it sets the form to be in the !canSubmit/isSubmitting state and just hangs there requiring a full page reload to reset the state. Should I add some formApi call in my onSubmit (within useForm) to reset the field without clearing the inputs? I am also using validators on each input field.
2 Replies
like-gold
like-gold12mo ago
Requiring a full page reload? That sounds weird. Can you reproduce the issue on a stackblitz? You fork one of the demos
quickest-silver
quickest-silverOP12mo ago
I think I was just misunderstanding how I should generally handle the state. I added a reset button and changed the css around the loading spinner/subscribe button and I think I have it working correctly

Did you find this page helpful?