From 48d1ef96a65e00aaa69e3383abf7d9684f7f2710 Mon Sep 17 00:00:00 2001 From: Theodor Steiner <40017636+Theo-Steiner@users.noreply.github.com> Date: Wed, 26 Jun 2024 22:25:25 +0900 Subject: [PATCH] fix(repl): attach listener above svelte event delegator (#12127) (#12135) --- sites/svelte-5-preview/src/lib/Output/srcdoc/index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sites/svelte-5-preview/src/lib/Output/srcdoc/index.html b/sites/svelte-5-preview/src/lib/Output/srcdoc/index.html index 21f049cbcc..202a5f973a 100644 --- a/sites/svelte-5-preview/src/lib/Output/srcdoc/index.html +++ b/sites/svelte-5-preview/src/lib/Output/srcdoc/index.html @@ -86,7 +86,8 @@ } if (action === 'catch_clicks') { - document.body.addEventListener('click', (event) => { + // attached to document to not interfere with svelte's event delegators that are attached to the app root (document.body) + document.addEventListener('click', (event) => { if (event.which !== 1) return; if (event.metaKey || event.ctrlKey || event.shiftKey) return; if (event.defaultPrevented) return;