File tree Expand file tree Collapse file tree 5 files changed +9
-0
lines changed
examples/form/src/components Expand file tree Collapse file tree 5 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " simple-stack-form " : patch
3+ ---
4+
5+ Fix accidental form submission on client validation errors
Original file line number Diff line number Diff 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 } }
Original file line number Diff line number Diff 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 } }
Original file line number Diff line number Diff 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 } }
Original file line number Diff line number Diff 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 } }
You can’t perform that action at this time.
0 commit comments