T
TanStack7mo ago
deep-jade

form.handleSubmit doesnt working(?)

Gist
form.tsx
GitHub Gist: instantly share code, notes, and snippets.
11 Replies
wise-white
wise-white7mo 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.
other-emerald
other-emerald7mo 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
deep-jade
deep-jadeOP7mo ago
I also tried with async and it didn't work :/
other-emerald
other-emerald7mo ago
give ksgn's suggestion a try. You can see if there's lingering errors somewhere that prevent submission or the like
deep-jade
deep-jadeOP7mo ago
I already solved it by passing the form.handle directly to the button. but is not the right way
other-emerald
other-emerald7mo ago
so does the <form onSubmit={} get called at all? the hierarchy seems to be correct in the gist you provided
deep-jade
deep-jadeOP7mo ago
No, it is not called.
other-emerald
other-emerald7mo ago
odd. Is your button type=„submit“ really inside the form?
deep-jade
deep-jadeOP7mo ago
yes
No description
other-emerald
other-emerald7mo 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
wise-white
wise-white7mo 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?