Skip to content

Commit 48d1ef9

Browse files
authored
fix(repl): attach listener above svelte event delegator (#12127) (#12135)
1 parent 872906c commit 48d1ef9

File tree

1 file changed

+2
-1
lines changed
  • sites/svelte-5-preview/src/lib/Output/srcdoc

1 file changed

+2
-1
lines changed

sites/svelte-5-preview/src/lib/Output/srcdoc/index.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@
8686
}
8787

8888
if (action === 'catch_clicks') {
89-
document.body.addEventListener('click', (event) => {
89+
// attached to document to not interfere with svelte's event delegators that are attached to the app root (document.body)
90+
document.addEventListener('click', (event) => {
9091
if (event.which !== 1) return;
9192
if (event.metaKey || event.ctrlKey || event.shiftKey) return;
9293
if (event.defaultPrevented) return;

0 commit comments

Comments
 (0)