diff --git a/packages/svelte/src/internal/client/dom/elements/transitions.js b/packages/svelte/src/internal/client/dom/elements/transitions.js index c8c297a394..dee029e88f 100644 --- a/packages/svelte/src/internal/client/dom/elements/transitions.js +++ b/packages/svelte/src/internal/client/dom/elements/transitions.js @@ -427,6 +427,10 @@ function animate(element, options, counterpart, t2, on_finish) { animation.cancel(); // This prevents memory leaks in Chromium animation.effect = null; + // This prevents onfinish to be launched after cancel(), + // which can happen in some rare cases + // see https://github.com/sveltejs/svelte/issues/13681 + animation.onfinish = noop; } }, deactivate: () => {