Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
etienne-dldc committed Jan 14, 2024
1 parent 926a513 commit e8e45fa
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/FormiController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,12 @@ export const FormiController = (() => {
}
unmount();
}
if (formEl === null) {
formEl = newFormEl;
formEl.addEventListener('submit', handleSubmit);
formEl.addEventListener('change', handleChange);
formEl.addEventListener('reset', handleReset);
}
const data = new FormData(formEl);
formEl = newFormEl;
formEl.addEventListener('submit', handleSubmit);
formEl.addEventListener('change', handleChange);
formEl.addEventListener('reset', handleReset);
if (validateOnMount) {
const data = new FormData(formEl);
store.dispatch({ type: 'Mount', data });
}
}
Expand Down

0 comments on commit e8e45fa

Please sign in to comment.