Skip to content

Commit d43cd85

Browse files
committed
fix: apply key animations on proxed arrays
1 parent ebbb5dd commit d43cd85

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-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 proxed arrays

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,8 @@ 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 = (flags & (EACH_ITEM_REACTIVE | EACH_INDEX_REACTIVE)) !== 0 || is_animated;
421422
var start = 0;
422423

423424
/** @type {null | Text | Element | Comment} */
@@ -500,7 +501,6 @@ function reconcile_tracked_array(
500501
mark_lis(sources);
501502
}
502503
// If keys are animated, we need to do updates before actual moves
503-
var is_animated = (flags & EACH_IS_ANIMATED) !== 0;
504504
var should_create;
505505
if (is_animated) {
506506
var i = b_length;

0 commit comments

Comments
 (0)