Skip to content

Commit b1d88fd

Browse files
committed
fix: preventDefault() on error
1 parent c524889 commit b1d88fd

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

examples/form/src/components/preact/Form.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export function Form({
7676
return formContext.trackAstroSubmitStatus();
7777
}
7878

79+
e.preventDefault();
7980
e.stopPropagation();
8081
formContext.setValidationErrors(parsed.fieldErrors);
8182
}}

examples/form/src/components/react/Form.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export function Form({
7878
return formContext.trackAstroSubmitStatus();
7979
}
8080

81+
e.preventDefault();
8182
e.stopPropagation();
8283
formContext.setValidationErrors(parsed.fieldErrors);
8384
}}

packages/form/templates/preact/Form.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export function Form({
7474
return formContext.trackAstroSubmitStatus();
7575
}
7676

77+
e.preventDefault();
7778
e.stopPropagation();
7879
formContext.setValidationErrors(parsed.fieldErrors);
7980
}}

packages/form/templates/react/Form.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export function Form({
7878
return formContext.trackAstroSubmitStatus();
7979
}
8080

81+
e.preventDefault();
8182
e.stopPropagation();
8283
formContext.setValidationErrors(parsed.fieldErrors);
8384
}}

0 commit comments

Comments
 (0)