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