From f4fb3445f18c27e8fd928523349262c118a4ad25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Pudil?= Date: Tue, 17 Dec 2024 10:02:34 +0100 Subject: [PATCH] netteForms: do not propagate 'submit' event further when the form is invalid --- src/assets/formValidator.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets/formValidator.ts b/src/assets/formValidator.ts index f02546db..7f03372a 100644 --- a/src/assets/formValidator.ts +++ b/src/assets/formValidator.ts @@ -438,7 +438,7 @@ export class FormValidator { form.addEventListener('submit', (e) => { if (!this.validateForm((e.submitter || form) as HTMLFormElement | FormElement)) { - e.stopPropagation(); + e.stopImmediatePropagation(); e.preventDefault(); } });