From 6d164196490e12f3d738d32a2435692fd16f689b Mon Sep 17 00:00:00 2001 From: Hayleigh Thompson Date: Tue, 14 May 2024 18:21:29 +0200 Subject: :bug: Fixed a bug where components would not properly report attribute changes. --- src/client-component.ffi.mjs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/client-component.ffi.mjs b/src/client-component.ffi.mjs index 89e3470..0dfc303 100644 --- a/src/client-component.ffi.mjs +++ b/src/client-component.ffi.mjs @@ -53,11 +53,7 @@ function makeComponent(init, update, view, on_attribute_change) { ); } - if (typeof value === "string") { - this.setAttribute(name, value); - } else { - this[`_${name}`] = value; - } + this[`_${name}`] = value; }, }); }); @@ -74,6 +70,10 @@ function makeComponent(init, update, view, on_attribute_change) { this.appendChild(this.#root); } + attributeChangedCallback(key, _, next) { + this[key] = next; + } + disconnectedCallback() { this.#application.send(new Shutdown()); } -- cgit v1.2.3