T
TanStack4mo ago
harsh-harlequin

form.handleSubmit doesnt working(?)

Gist
form.tsx
GitHub Gist: instantly share code, notes, and snippets.
11 Replies
quickest-silver
quickest-silver4mo ago
https://discord.com/channels/719702312431386674/1374880566587035648/1375008082051993641 I would add a debugger; in the onSubmit and onSubmitInvalid to see what's happening as well. I can't see what's wrong from your video or gist.
metropolitan-bronze
metropolitan-bronze4mo ago
is login not async? you're not awaiting it it probably works but immediately 'completes' since it doesn't await logging in during onSubmit
harsh-harlequin
harsh-harlequinOP4mo ago
I also tried with async and it didn't work :/
metropolitan-bronze
metropolitan-bronze4mo ago
give ksgn's suggestion a try. You can see if there's lingering errors somewhere that prevent submission or the like
harsh-harlequin
harsh-harlequinOP4mo ago
I already solved it by passing the form.handle directly to the button. but is not the right way
metropolitan-bronze
metropolitan-bronze4mo ago
so does the <form onSubmit={} get called at all? the hierarchy seems to be correct in the gist you provided
harsh-harlequin
harsh-harlequinOP4mo ago
No, it is not called.
metropolitan-bronze
metropolitan-bronze4mo ago
odd. Is your button type=„submit“ really inside the form?
harsh-harlequin
harsh-harlequinOP4mo ago
yes
No description
metropolitan-bronze
metropolitan-bronze4mo ago
maybe the custom button component messes with event propagation? but based on the import path, is that shadcn? definitely wouldn‘t if that‘s the case
quickest-silver
quickest-silver4mo ago
maybe the custom button component messes with event propagation?
To dismiss this you could just put a regular <button type="submit">Submit</button> inside your <form> and click that.

Did you find this page helpful?