form.handleSubmit doesnt working(?)
11 Replies
quickest-silver•4mo 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•4mo 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-harlequinOP•4mo ago
I also tried with async and it didn't work :/
metropolitan-bronze•4mo ago
give ksgn's suggestion a try. You can see if there's lingering errors somewhere that prevent submission or the like
harsh-harlequinOP•4mo ago
I already solved it by passing the form.handle directly to the button.
but is not the right way
metropolitan-bronze•4mo ago
so does the
<form onSubmit={}
get called at all? the hierarchy seems to be correct in the gist you providedharsh-harlequinOP•4mo ago
No, it is not called.
metropolitan-bronze•4mo ago
odd. Is your
button type=„submit“
really inside the form
?harsh-harlequinOP•4mo ago
yes

metropolitan-bronze•4mo 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•4mo 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.