Skip to content

Commit

Permalink
Merge pull request #79 from LiteracyFanatic/fix-firefox-submit-bug
Browse files Browse the repository at this point in the history
Fix unintended submissions in Firefox caused by undefined value
  • Loading branch information
haacked authored Nov 2, 2023
2 parents 4956e54 + 2f2096e commit fcb2870
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -747,9 +747,11 @@ export class ValidationService {
* @param success The validation result.
* @param submitEvent The `SubmitEvent`.
*/
handleValidated = (form: HTMLFormElement, success: boolean, submitEvent: SubmitEvent) => {
handleValidated = (form: HTMLFormElement, success: boolean, submitEvent?: SubmitEvent) => {
if (success) {
this.submitValidForm(form, submitEvent);
if (submitEvent) {
this.submitValidForm(form, submitEvent);
}
}
else {
this.focusFirstInvalid(form);
Expand Down

0 comments on commit fcb2870

Please sign in to comment.