Skip to content

Commit f6331a6

Browse files
committed
fix: improve reconcilation of inert each block rows
1 parent c5fa0b4 commit f6331a6

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.changeset/unlucky-baboons-greet.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: improve reconcilation of inert each block rows

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,11 @@ function reconcile(array, state, anchor, render_fn, flags, get_key) {
373373
stashed = [];
374374

375375
while (current !== null && current.k !== key) {
376-
(seen ??= new Set()).add(current);
376+
// If the item has an effect that is already inert, skip over adding it
377+
// to our seen Set as the item is already being handled
378+
if ((current.e.f & INERT) === 0) {
379+
(seen ??= new Set()).add(current);
380+
}
377381
stashed.push(current);
378382
current = current.next;
379383
}

0 commit comments

Comments
 (0)