Fix template node text children don't overwrite other children

This commit is contained in:
nathan 2024-08-15 10:20:02 -06:00
parent 969164e7d3
commit a834809423

View File

@ -709,7 +709,7 @@ const Et2WidgetMixin = <T extends Constructor>(superClass : T) =>
{
if(node.data.replace(/^\s+|\s+$/g, ''))
{
this.innerText = node.data;
this.appendChild(node.cloneNode());
}
continue;
}
@ -780,6 +780,13 @@ const Et2WidgetMixin = <T extends Constructor>(superClass : T) =>
_nodeName = attributes["type"] = this.getArrayMgr('content').expandName(_nodeName);
}
// If using type attribute instead of nodeName makes things invalid, don't
// Some widgets use their type attribute
if(_node.hasAttribute("type") && !window.customElements.get(_nodeName) && typeof et2_registry[_nodeName] === "undefined" && window.customElements.get(_node.nodeName.toLowerCase()))
{
_nodeName = _node.nodeName.toLowerCase();
}
let widget;
if(undefined == window.customElements.get(_nodeName))
{