From 63661b028f75640ac69f67bc4ba30a80d2611171 Mon Sep 17 00:00:00 2001 From: Dominic Gannaway Date: Wed, 27 Mar 2024 01:05:42 +0000 Subject: [PATCH] revise revise-this --- .../svelte/src/internal/client/dom/elements/bindings/this.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/svelte/src/internal/client/dom/elements/bindings/this.js b/packages/svelte/src/internal/client/dom/elements/bindings/this.js index 237b2bc3ee..99a9100793 100644 --- a/packages/svelte/src/internal/client/dom/elements/bindings/this.js +++ b/packages/svelte/src/internal/client/dom/elements/bindings/this.js @@ -45,6 +45,8 @@ export function bind_this(element_or_component, update, get_value, get_parts) { }); }); + // Defer to the next tick so that all updates can be reconciled first. + // This solves the case where one variable is shared across multiple this-bindings. effect(() => { return () => { if (parts && is_bound_this(get_value(...parts), element_or_component)) {