From 2014d019cc350458ba21973eb70ddde8f46018e1 Mon Sep 17 00:00:00 2001 From: Morten Bo Date: Mon, 9 Dec 2024 10:12:09 +0100 Subject: [PATCH] Incito: Stop propagation when clicking links and carousel arrows --- lib/incito-browser/incito.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/incito-browser/incito.ts b/lib/incito-browser/incito.ts index 78627277..9c8372e3 100644 --- a/lib/incito-browser/incito.ts +++ b/lib/incito-browser/incito.ts @@ -812,6 +812,8 @@ export default class Incito extends MicroEvent<{ const link = linkEl ? linkEl.dataset.link : null; if (isDefinedStr(link)) { + e.stopPropagation(); + window.open(link!, '_blank'); } @@ -821,6 +823,8 @@ export default class Incito extends MicroEvent<{ const scrollLeft = carouselEl.scrollLeft; if (carouselPrevEl) { + e.stopPropagation(); + const newScrollLeft = scrollLeft - clientWidth; if (newScrollLeft < 0) { @@ -835,6 +839,8 @@ export default class Incito extends MicroEvent<{ }); } } else if (carouselNextEl) { + e.stopPropagation(); + const newScrollLeft = scrollLeft + clientWidth; if (newScrollLeft >= scrollWidth) {