Skip to content

Commit 6acf7f3

Browse files
authored
fix: apply key animations on proxied arrays (#10113)
* fix: apply key animations on proxed arrays * fix: apply key animations on proxed arrays * fix: apply key animations on proxed arrays
1 parent ebbb5dd commit 6acf7f3

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.changeset/itchy-terms-guess.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: apply key animations on proxied arrays

packages/svelte/src/internal/client/each.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,9 @@ function reconcile_tracked_array(
417417
insert_each_item_block(block, dom, is_controlled, null);
418418
}
419419
} else {
420-
var should_update_block = (flags & (EACH_ITEM_REACTIVE | EACH_INDEX_REACTIVE)) !== 0;
420+
var is_animated = (flags & EACH_IS_ANIMATED) !== 0;
421+
var should_update_block =
422+
(flags & (EACH_ITEM_REACTIVE | EACH_INDEX_REACTIVE)) !== 0 || is_animated;
421423
var start = 0;
422424

423425
/** @type {null | Text | Element | Comment} */
@@ -500,7 +502,6 @@ function reconcile_tracked_array(
500502
mark_lis(sources);
501503
}
502504
// If keys are animated, we need to do updates before actual moves
503-
var is_animated = (flags & EACH_IS_ANIMATED) !== 0;
504505
var should_create;
505506
if (is_animated) {
506507
var i = b_length;

0 commit comments

Comments
 (0)