form.handleSubmit doesnt working(?)
11 Replies
wise-white•7mo 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•7mo ago
is
login not async? you're not awaiting it
it probably works but immediately 'completes' since it doesn't await logging in during onSubmitdeep-jadeOP•7mo ago
I also tried with async and it didn't work :/
other-emerald•7mo ago
give ksgn's suggestion a try. You can see if there's lingering errors somewhere that prevent submission or the like
deep-jadeOP•7mo ago
I already solved it by passing the form.handle directly to the button.
but is not the right way
other-emerald•7mo ago
so does the
<form onSubmit={} get called at all? the hierarchy seems to be correct in the gist you provideddeep-jadeOP•7mo ago
No, it is not called.
other-emerald•7mo ago
odd. Is your
button type=„submit“ really inside the form?deep-jadeOP•7mo ago
yes

other-emerald•7mo 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•7mo 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.