From aeef09ed2511cb49b8672d1b45415394f5857ed4 Mon Sep 17 00:00:00 2001 From: Dominic Gannaway Date: Thu, 4 Apr 2024 16:43:03 +0100 Subject: [PATCH] better fix --- .../svelte/src/internal/client/dom/elements/transitions.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/svelte/src/internal/client/dom/elements/transitions.js b/packages/svelte/src/internal/client/dom/elements/transitions.js index 90de4dae7b..9167b0cf83 100644 --- a/packages/svelte/src/internal/client/dom/elements/transitions.js +++ b/packages/svelte/src/internal/client/dom/elements/transitions.js @@ -311,7 +311,9 @@ function animate(element, options, counterpart, t2, callback) { if (animation.startTime !== null && animation.currentTime !== null) { throw e; } - callback?.(); + if (!element.isConnected) { + callback?.(); + } }); } else { // Timer