diff options
author | Hayleigh Thompson <me@hayleigh.dev> | 2024-06-11 17:47:39 +0100 |
---|---|---|
committer | Hayleigh Thompson <me@hayleigh.dev> | 2024-06-11 18:24:57 +0100 |
commit | c627d12f3f1e787a1e5dfee34d0fc13a2f60d152 (patch) | |
tree | 77e8b85aed705aece9d0ca3841e3f094c7d9ee99 /src/vdom.ffi.mjs | |
parent | 3d76514b9001e293a89dc735605fed3719fed9b9 (diff) | |
download | lustre-c627d12f3f1e787a1e5dfee34d0fc13a2f60d152.tar.gz lustre-c627d12f3f1e787a1e5dfee34d0fc13a2f60d152.zip |
:bug: Fixed a bug where attributes were set even when they hadn't changed.
Diffstat (limited to 'src/vdom.ffi.mjs')
-rw-r--r-- | src/vdom.ffi.mjs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vdom.ffi.mjs b/src/vdom.ffi.mjs index d4cc117..73d7f08 100644 --- a/src/vdom.ffi.mjs +++ b/src/vdom.ffi.mjs @@ -279,7 +279,7 @@ function createElementNode({ prev, next, dispatch, stack }) { // tell which attributes are mirrored as properties on the DOM node we assume // that all attributes should be set as properties too. else { - if (typeof value === "string") el.setAttribute(name, value); + if (el.getAttribute(name) !== value) el.setAttribute(name, value); if (name === "value" || name === "selected") el[name] = value; // If we're morphing an element we remove this attribute's name from the set // of attributes that were on the previous render so we don't remove it in |