Skip to content

Commit

Permalink
fix: preventDefault() on error
Browse files Browse the repository at this point in the history
  • Loading branch information
bholmesdev committed Jan 1, 2024
1 parent c524889 commit b1d88fd
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/form/src/components/preact/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export function Form({
return formContext.trackAstroSubmitStatus();
}

e.preventDefault();
e.stopPropagation();
formContext.setValidationErrors(parsed.fieldErrors);
}}
Expand Down
1 change: 1 addition & 0 deletions examples/form/src/components/react/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export function Form({
return formContext.trackAstroSubmitStatus();
}

e.preventDefault();
e.stopPropagation();
formContext.setValidationErrors(parsed.fieldErrors);
}}
Expand Down
1 change: 1 addition & 0 deletions packages/form/templates/preact/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export function Form({
return formContext.trackAstroSubmitStatus();
}

e.preventDefault();
e.stopPropagation();
formContext.setValidationErrors(parsed.fieldErrors);
}}
Expand Down
1 change: 1 addition & 0 deletions packages/form/templates/react/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export function Form({
return formContext.trackAstroSubmitStatus();
}

e.preventDefault();
e.stopPropagation();
formContext.setValidationErrors(parsed.fieldErrors);
}}
Expand Down

0 comments on commit b1d88fd

Please sign in to comment.