Fix uneeded remove & re-add of WebComponent widgets to legacy parent

This fixes the incorrect vertical ordering of the preferences dialog (was tabs, header, footer )
This commit is contained in:
nathan 2021-09-17 13:12:24 -06:00
parent d944372e14
commit fa5dcc2a3c
2 changed files with 2 additions and 7 deletions

View File

@ -9,6 +9,7 @@ import type {IegwAppLocal} from "../../jsapi/egw_global";
import {ClassWithAttributes, ClassWithInterfaces} from "../et2_core_inheritance"; import {ClassWithAttributes, ClassWithInterfaces} from "../et2_core_inheritance";
import {css, dedupeMixin} from "@lion/core"; import {css, dedupeMixin} from "@lion/core";
import type {et2_container} from "../et2_core_baseWidget"; import type {et2_container} from "../et2_core_baseWidget";
import type {et2_DOMWidget} from "../et2_core_DOMWidget";
/** /**
* This mixin will allow any LitElement to become an Et2Widget * This mixin will allow any LitElement to become an Et2Widget
@ -604,7 +605,7 @@ const Et2WidgetMixin = (superClass) =>
* rest themselves with their normal lifecycle (especially connectedCallback(), which is kind * rest themselves with their normal lifecycle (especially connectedCallback(), which is kind
* of the equivalent of doLoadingFinished() * of the equivalent of doLoadingFinished()
*/ */
if(this.getParent() instanceof et2_widget && this.getParent().getDOMNode(this)) if(this.getParent() instanceof et2_widget && (<et2_DOMWidget>this.getParent()).getDOMNode(this) != this.parentNode)
{ {
this.getParent().getDOMNode(this).append(this); this.getParent().getDOMNode(this).append(this);
} }

View File

@ -804,12 +804,6 @@ export class et2_widget extends ClassWithAttributes
else else
{ {
widget = loadWebComponent(_nodeName, _node, this); widget = loadWebComponent(_nodeName, _node, this);
if (this.addChild)
{
// webcomponent going into old et2_widget
this.addChild(widget);
}
} }
return widget; return widget;
} }