T
TanStack15mo ago
robust-apricot

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
rare-sapphire
rare-sapphire15mo ago
Requiring a full page reload? That sounds weird. Can you reproduce the issue on a stackblitz? You fork one of the demos
robust-apricot
robust-apricotOP15mo 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?