Don't break everything if something goes wrong cloning webcomponent for nm row

This commit is contained in:
nathan 2022-05-04 17:27:58 -06:00
parent 54b2ac54b1
commit 3c6c2aec1a

View File

@ -180,6 +180,11 @@ export class et2_nextmatch_rowProvider
if(typeof window.customElements.get(widget.localName) != "undefined")
{
widget = this._cloneWebComponent(entry, row, data);
if(!widget)
{
console.warn("Error cloning ", entry);
continue;
}
}
else
{
@ -274,6 +279,11 @@ export class et2_nextmatch_rowProvider
// Use the clone, not the original
let widget = entry.nodeFuncs[0](row);
if(!widget || widget.localName !== entry.widget.localName)
{
return null;
}
// Need to set the parent to the nm or egw() (and probably others) will not be as expected, using window instead
// of app. arrayMgrs are fine without this though
widget._parent = this._context;