fix: conditionally rendered element under fragment in island does not render (#1172)
This might be fixing #502, but I am not sure. All tests pass. I've added additional test cases for comments from #502 --------- Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
This commit is contained in:
+8
-8
@@ -6,20 +6,20 @@ function createRootFragment(
|
||||
replaceNode: Node | Node[],
|
||||
) {
|
||||
replaceNode = ([] as Node[]).concat(replaceNode);
|
||||
const s = replaceNode[replaceNode.length - 1].nextSibling;
|
||||
function insert(c: Node, r: Node) {
|
||||
parent.insertBefore(c, r || s);
|
||||
}
|
||||
// @ts-ignore this is fine
|
||||
return parent.__k = {
|
||||
nodeType: 1,
|
||||
parentNode: parent,
|
||||
firstChild: replaceNode[0],
|
||||
childNodes: replaceNode,
|
||||
insertBefore: insert,
|
||||
appendChild: insert,
|
||||
removeChild: function (c: Node) {
|
||||
parent.removeChild(c);
|
||||
insertBefore(node: Node, child: Node) {
|
||||
parent.insertBefore(node, child);
|
||||
},
|
||||
appendChild(child: Node) {
|
||||
parent.appendChild(child);
|
||||
},
|
||||
removeChild(child: Node) {
|
||||
parent.removeChild(child);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user