Skip to content

Commit

Permalink
fix stoppropagation
Browse files Browse the repository at this point in the history
  • Loading branch information
shairez committed Nov 27, 2024
1 parent 2a6a959 commit 19adfd8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/qwik/src/qwikloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 19adfd8

Please sign in to comment.