Skip to content

Commit de88a01

Browse files
authored
fix: stop propagation on form submit (#178)
1 parent 17f041a commit de88a01

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/Form.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,10 @@ const _Form: Form = React.forwardRef(
430430
};
431431

432432
const handleSubmit = (e?: React.SyntheticEvent) => {
433-
if (e && e.preventDefault) e.preventDefault();
433+
if (e && e.preventDefault && e.stopPropagation) {
434+
e.preventDefault();
435+
e.stopPropagation();
436+
}
434437
clearPendingValidations();
435438
submitTimeout.set(() => submit().catch(done));
436439
};

0 commit comments

Comments
 (0)