aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHayleigh Thompson <me@hayleigh.dev>2024-03-31 21:20:48 +0100
committerHayleigh Thompson <me@hayleigh.dev>2024-03-31 21:20:48 +0100
commitd0e750fe594da004a6492562aab3d697d117dd6f (patch)
tree597868d8dc4cc187f4a4ad34f960c81bedf2b770
parent2514ca0272a3b5270915b1ee9e48a9c4244b2749 (diff)
downloadlustre-d0e750fe594da004a6492562aab3d697d117dd6f.tar.gz
lustre-d0e750fe594da004a6492562aab3d697d117dd6f.zip
:bug: Fixed a bug where child nodes were incorrectly morphed for disjoint parents.
-rw-r--r--src/vdom.ffi.mjs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vdom.ffi.mjs b/src/vdom.ffi.mjs
index 2515eb4..1c150ef 100644
--- a/src/vdom.ffi.mjs
+++ b/src/vdom.ffi.mjs
@@ -268,7 +268,7 @@ function createElementNode({ prev, next, dispatch, stack }) {
// that all attributes should be set as properties too.
else {
el.setAttribute(name, value);
- if (name in el) el[name] = value;
+ if (name === "value") 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
// the next step.
@@ -312,7 +312,7 @@ function createElementNode({ prev, next, dispatch, stack }) {
return el;
}
- let prevChild = prev?.firstChild;
+ let prevChild = el.firstChild;
// These variables are set up for keyed children diffs. When children are keyed
// we can effeciently reuse DOM nodes even if they've moved around in the list.
let seenKeys = null;