fix: ensure each block animations don't mess with transitions (#17238)

This ensures that an animation does not run when the element is first transitioning in. Else the animation would mess with the transition (overriding its animation basically). Due to our test setup it's not testable but I veryfied it fixes #17181 (tested all reproductions in there)
pull/17245/head
Simon H 2 weeks ago committed by GitHub
parent e3acf5deea
commit d0e61bc252
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: ensure each block animations don't mess with transitions

@ -394,8 +394,12 @@ function reconcile(state, array, anchor, flags, get_key) {
key = get_key(value, i);
item = /** @type {EachItem} */ (items.get(key));
item.a?.measure();
(to_animate ??= new Set()).add(item);
// offscreen == coming in now, no animation in that case,
// else this would happen https://github.com/sveltejs/svelte/issues/17181
if (item.o) {
item.a?.measure();
(to_animate ??= new Set()).add(item);
}
}
}

Loading…
Cancel
Save