fable-lit-fullstack-template icon indicating copy to clipboard operation
fable-lit-fullstack-template copied to clipboard

Form template fires twice when submitted using enter key

Open leolorenzoluis opened this issue 3 years ago • 4 comments

leolorenzoluis avatar Aug 05 '22 05:08 leolorenzoluis

Did you use e.preventDefault()?

<form @submit={Ev (fun e -> e.preventDefault(); save())}>

</form>

JordanMarr avatar Aug 05 '22 13:08 JordanMarr

Yes

leolorenzoluis avatar Aug 17 '22 00:08 leolorenzoluis

And you are using a <input type="submit"> button?

JordanMarr avatar Aug 17 '22 18:08 JordanMarr

Correct, I also tried what others said e.stopImmediatePropagation();

leolorenzoluis avatar Aug 17 '22 20:08 leolorenzoluis