aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHayleigh Thompson <me@hayleigh.dev>2024-04-01 15:23:51 +0100
committerHayleigh Thompson <me@hayleigh.dev>2024-04-01 15:23:51 +0100
commit0a1db7df007d2e4f71018591f30fa76a2f05279e (patch)
treee800896ed9537b657e59e938cdcfeae326464887 /src
parent92f85d405f01199e3d47dc924134dcd54f0105d5 (diff)
downloadlustre-0a1db7df007d2e4f71018591f30fa76a2f05279e.tar.gz
lustre-0a1db7df007d2e4f71018591f30fa76a2f05279e.zip
:bug: Fixed a bug where text nodes were patched even when their content was equal.
Diffstat (limited to 'src')
-rw-r--r--src/vdom.ffi.mjs2
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);