From 543d327b5c732d39f0f42bb2b7cf00318f6c8bc7 Mon Sep 17 00:00:00 2001 From: OFF0 Date: Fri, 28 Jul 2023 11:44:12 +0200 Subject: [PATCH] feed: ignore shift click the global click callback should ignore shift click which allows to use native browser behavior (open link in new window). --- src/main.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.ts b/src/main.ts index d044984..7d9eb43 100644 --- a/src/main.ts +++ b/src/main.ts @@ -278,13 +278,13 @@ const handleButton = (button: HTMLButtonElement) => { }; document.body.addEventListener('click', (event: MouseEvent) => { + // dont intercept command or shift-click + if (event.metaKey || event.shiftKey) { + return; + } const target = event.target as HTMLElement; const a = target?.closest('a'); if (a) { - // dont intercept command-click - if (event.metaKey) { - return; - } handleLink(a, event); return; }