Skip to content

Commit 692452a

Browse files
jiripudildg
authored andcommitted
netteForms: do not propagate 'submit' event further when the form is invalid
1 parent e499e54 commit 692452a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/assets/formValidator.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ export class FormValidator {
438438

439439
form.addEventListener('submit', (e) => {
440440
if (!this.validateForm((e.submitter || form) as HTMLFormElement | FormElement)) {
441-
e.stopPropagation();
441+
e.stopImmediatePropagation();
442442
e.preventDefault();
443443
}
444444
});

0 commit comments

Comments
 (0)