diff --git a/api/js/etemplate/Et2Widget/Et2Widget.ts b/api/js/etemplate/Et2Widget/Et2Widget.ts index ab713905b5..b32f66ff7c 100644 --- a/api/js/etemplate/Et2Widget/Et2Widget.ts +++ b/api/js/etemplate/Et2Widget/Et2Widget.ts @@ -709,7 +709,7 @@ const Et2WidgetMixin = (superClass : T) => { if(node.data.replace(/^\s+|\s+$/g, '')) { - this.innerText = node.data; + this.appendChild(node.cloneNode()); } continue; } @@ -780,6 +780,13 @@ const Et2WidgetMixin = (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)) {