diff --git a/src/runtime/internal/scheduler.ts b/src/runtime/internal/scheduler.ts index e3d7181fcb..7c9c7d007e 100644 --- a/src/runtime/internal/scheduler.ts +++ b/src/runtime/internal/scheduler.ts @@ -35,6 +35,9 @@ export function flush() { const seen_callbacks = new Set(); do { + // invalidate bindings before checking dirty_components + while (binding_callbacks.length) binding_callbacks.pop()(); + // first, call beforeUpdate functions // and update components while (dirty_components.length) { @@ -43,8 +46,6 @@ export function flush() { update(component.$$); } - while (binding_callbacks.length) binding_callbacks.pop()(); - // then, once components are updated, call // afterUpdate functions. This may cause // subsequent updates...