Guard domAppend/domInsertAfter against spread values
Spread values (from ~cssx/tw etc.) are attribute dicts, not DOM nodes. When they appear in non-element contexts (fragments, islands, lakes, reactive branches), they must not be passed to appendChild/insertBefore. Add _spread guard to platform domAppend and domInsertAfter — fixes TypeError: Node.appendChild: Argument 1 does not implement interface Node. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1620,7 +1620,7 @@ PLATFORM_DOM_JS = """
|
||||
}
|
||||
|
||||
function domAppend(parent, child) {
|
||||
if (parent && child) parent.appendChild(child);
|
||||
if (parent && child && !child._spread) parent.appendChild(child);
|
||||
}
|
||||
|
||||
function domPrepend(parent, child) {
|
||||
@@ -1692,7 +1692,7 @@ PLATFORM_DOM_JS = """
|
||||
}
|
||||
|
||||
function domInsertAfter(ref, node) {
|
||||
if (ref && ref.parentNode && node) {
|
||||
if (ref && ref.parentNode && node && !node._spread) {
|
||||
ref.parentNode.insertBefore(node, ref.nextSibling);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user