From 19adfd8cf570096d4dc4bcba07f5789ecd29ebda Mon Sep 17 00:00:00 2001 From: Shai Reznik Date: Wed, 27 Nov 2024 02:52:04 +0200 Subject: [PATCH] fix stoppropagation --- packages/qwik/src/qwikloader.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/qwik/src/qwikloader.ts b/packages/qwik/src/qwikloader.ts index 4cb2e60444b..58ad3f4d07f 100644 --- a/packages/qwik/src/qwikloader.ts +++ b/packages/qwik/src/qwikloader.ts @@ -90,6 +90,9 @@ export const qwikLoader = ( if (element.hasAttribute('preventdefault:' + eventName)) { ev.preventDefault(); } + if (element.hasAttribute('stoppropagation:' + eventName)) { + ev.stopPropagation(); + } const ctx = element['_qc_']; const relevantListeners = ctx && ctx.li.filter((li) => li[0] === attrName); if (relevantListeners && relevantListeners.length > 0) { @@ -256,7 +259,7 @@ export const qwikLoader = ( events.add(eventNameOrNode); } } else { - // If it is a new root, we also need this root to catch up to all of the events sofar. + // If it is a new root, we also need this root to catch up to all of the events so far. if (!roots.has(eventNameOrNode)) { events.forEach((eventName) => addEventListener(eventNameOrNode, eventName, processDocumentEvent, true)