From 6ca9f67adb29e939244c76f02c591af50304fda9 Mon Sep 17 00:00:00 2001 From: hugos68 Date: Tue, 30 Apr 2024 14:47:14 +0200 Subject: [PATCH] Properly cleanup timeouts --- src/lib/hooks/useHover/index.svelte.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/hooks/useHover/index.svelte.ts b/src/lib/hooks/useHover/index.svelte.ts index 02201aae..8f3f22c0 100644 --- a/src/lib/hooks/useHover/index.svelte.ts +++ b/src/lib/hooks/useHover/index.svelte.ts @@ -103,7 +103,11 @@ class Hover { this.#floating = floating; this.#options = options; - $effect(() => this.#clearTimeouts()); + $effect(() => { + return () => { + this.#clearTimeouts(); + }; + }); } get reference() {