diff options
author | Hayleigh Thompson <me@hayleigh.dev> | 2024-04-01 15:23:51 +0100 |
---|---|---|
committer | Hayleigh Thompson <me@hayleigh.dev> | 2024-04-01 15:23:51 +0100 |
commit | 0a1db7df007d2e4f71018591f30fa76a2f05279e (patch) | |
tree | e800896ed9537b657e59e938cdcfeae326464887 | |
parent | 92f85d405f01199e3d47dc924134dcd54f0105d5 (diff) | |
download | lustre-0a1db7df007d2e4f71018591f30fa76a2f05279e.tar.gz lustre-0a1db7df007d2e4f71018591f30fa76a2f05279e.zip |
:bug: Fixed a bug where text nodes were patched even when their content was equal.
-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 1c150ef..8d5c287 100644 --- a/src/vdom.ffi.mjs +++ b/src/vdom.ffi.mjs @@ -36,7 +36,7 @@ export function morph(prev, next, dispatch, isComponent = false) { parent.appendChild(created); out ??= created; } else if (prev.nodeType === Node.TEXT_NODE) { - prev.textContent = next.content; + if (prev.textContent !== next.content) prev.textContent = next.content; out ??= prev; } else { const created = document.createTextNode(next.content); |