Skip to content

Commit 20ae428

Browse files
committed
better fix
1 parent 0b4c67c commit 20ae428

File tree

2 files changed

+7
-8
lines changed
  • packages/svelte/src/internal/client/dom

2 files changed

+7
-8
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,10 @@ export function each(node, flags, get_collection, get_key, render_fn, fallback_f
205205

206206
if (!hydrating) {
207207
reconcile(array, state, anchor, render_fn, flags, get_key);
208+
// Reconciling can cause the collection to become unstable if any inner effects
209+
// have mutated the collection since reconcialtion. Reading the collection again
210+
// will fix this
211+
get_collection();
208212
}
209213

210214
if (fallback_fn !== null) {

packages/svelte/src/internal/client/dom/elements/bindings/input.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,14 +180,9 @@ export function bind_checked(input, get, set = get) {
180180
set(value);
181181
});
182182

183-
// We defer setting the value as we might already be in an active
184-
// block like an each block where that effect hasn't yet hooked up
185-
// to the reactivity graph
186-
queue_micro_task(() => {
187-
if (get() == undefined) {
188-
set(false);
189-
}
190-
});
183+
if (get() == undefined) {
184+
set(false);
185+
}
191186

192187
render_effect(() => {
193188
var value = get();

0 commit comments

Comments
 (0)