From 63c3310a8f3c047a3f5e4e47f123b7bfd86d98dc Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 11 Jun 2021 13:17:38 +0100 Subject: [PATCH] Move HoverIndicator mouseleave handler to body element for better detection rates --- packages/client/src/components/preview/HoverIndicator.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/src/components/preview/HoverIndicator.svelte b/packages/client/src/components/preview/HoverIndicator.svelte index 43c22725b5..d049a1f94b 100644 --- a/packages/client/src/components/preview/HoverIndicator.svelte +++ b/packages/client/src/components/preview/HoverIndicator.svelte @@ -20,12 +20,12 @@ onMount(() => { document.addEventListener("mouseover", onMouseOver) - window.addEventListener("mouseleave", onMouseLeave) + document.body.addEventListener("mouseleave", onMouseLeave) }) onDestroy(() => { document.removeEventListener("mouseover", onMouseOver) - window.removeEventListener("mouseleave", onMouseLeave) + document.body.removeEventListener("mouseleave", onMouseLeave) })