diff --git a/.changeset/itchy-terms-guess.md b/.changeset/itchy-terms-guess.md new file mode 100644 index 0000000000..b101a6c138 --- /dev/null +++ b/.changeset/itchy-terms-guess.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: apply key animations on proxied arrays diff --git a/packages/svelte/src/internal/client/each.js b/packages/svelte/src/internal/client/each.js index 8d9ef0e7c7..c51af78572 100644 --- a/packages/svelte/src/internal/client/each.js +++ b/packages/svelte/src/internal/client/each.js @@ -417,7 +417,9 @@ 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 +502,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;