diff --git a/.changeset/itchy-terms-guess.md b/.changeset/itchy-terms-guess.md new file mode 100644 index 0000000000..833c1277b1 --- /dev/null +++ b/.changeset/itchy-terms-guess.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: apply key animations on proxed arrays diff --git a/packages/svelte/src/internal/client/each.js b/packages/svelte/src/internal/client/each.js index 8d9ef0e7c7..1305116e19 100644 --- a/packages/svelte/src/internal/client/each.js +++ b/packages/svelte/src/internal/client/each.js @@ -417,7 +417,8 @@ function reconcile_tracked_array( insert_each_item_block(block, dom, is_controlled, null); } } else { - var should_update_block = (flags & (EACH_ITEM_REACTIVE | EACH_INDEX_REACTIVE)) !== 0; + var is_animated = (flags & EACH_IS_ANIMATED) !== 0; + var should_update_block = (flags & (EACH_ITEM_REACTIVE | EACH_INDEX_REACTIVE)) !== 0 || is_animated; var start = 0; /** @type {null | Text | Element | Comment} */ @@ -500,7 +501,6 @@ function reconcile_tracked_array( mark_lis(sources); } // If keys are animated, we need to do updates before actual moves - var is_animated = (flags & EACH_IS_ANIMATED) !== 0; var should_create; if (is_animated) { var i = b_length;