diff --git a/packages/csx-custom-elements/src/vdom/render.js b/packages/csx-custom-elements/src/vdom/render.js index 952e4df..20d6a55 100644 --- a/packages/csx-custom-elements/src/vdom/render.js +++ b/packages/csx-custom-elements/src/vdom/render.js @@ -156,7 +156,6 @@ export function render(vnode, opts = {}) { } } - let sortedChildTypes = Array.from(childTypes).sort((a,b)=>a==='node'?1:-1); // Always do ChildNode-types last let queuedItems = []; @@ -209,30 +208,10 @@ export function render(vnode, opts = {}) { // Subsequent child previous.host.after(item.host); } - //item.parent.appendChild(item.host); } } if(!item.parent) newRoot = item.host; - } - - // //if(item.host instanceof Element || item.host instanceof Text){// Not good enough, both Element and Text inherit from Node, which would make more sense, but ShadowRoot also inherits from node, and unlike the others it shouldnt be appended as a child-element - // if(item.host instanceof ShadowRoot){ - // console.log("I expected a crash here...", item); - // } - // if(item.host instanceof Node){ - // let parent = item.parent; - // if(parent){ - // //parent.insertBefore(nextChildNode, childNodes[i])// When its not the last el... - // parent.appendChild(item.host); - // }else{ - // newRoot = item.host;// This could be implemented as refs... - // } - // } - // if(item.host instanceof ShadowRoot){ - // //console.log("Does this work then?..", item); - // // item.parent.removeChild(item.host);// No it does not! - // } } return newRoot; }