fix : Rapidly toggling element with out: transition causes incorrect node removal (#13884)

* set onfinish to null to fix a rare bug

* replace null by noop
pull/13895/head
adiGuba 2 months ago committed by GitHub
parent 42ccdc1023
commit d0177711b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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: () => {

Loading…
Cancel
Save