Skip to content

Commit

Permalink
fix: add stopPropagation to form handler
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanfilhoz committed May 13, 2024
1 parent b17e452 commit b34bf1c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "safe-form",
"version": "0.8.1",
"version": "0.8.2",
"description": "⚡️ End-to-end type-safety from client to server.",
"main": "dist/safe-form.es.js",
"types": "dist/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions src/useForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ export const useForm = <Input extends FormInput, FormResponse>({
return {
onSubmit: async (event: SyntheticEvent<HTMLFormElement>) => {
event.preventDefault()
event.stopPropagation()

// Reset field errors
setFieldErrors({})
Expand Down

0 comments on commit b34bf1c

Please sign in to comment.