fix(overlays): only teardown when overlayCtrl defined
This commit is contained in:
parent
e04ae769ea
commit
121e1562fa
1 changed files with 12 additions and 10 deletions
|
|
@ -158,6 +158,10 @@ export const OverlayMixin = dedupeMixin(
|
|||
super.disconnectedCallback();
|
||||
}
|
||||
|
||||
if (!this._overlayCtrl) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._overlayDisconnectComplete = new Promise((resolve, reject) => {
|
||||
this.__resolveOverlayDisconnectComplete = resolve;
|
||||
this.__rejectOverlayDisconnectComplete = reject;
|
||||
|
|
@ -168,7 +172,6 @@ export const OverlayMixin = dedupeMixin(
|
|||
this.__resolveOverlayDisconnectComplete();
|
||||
});
|
||||
|
||||
if (this._overlayCtrl) {
|
||||
// We need to prevent that we create a setup/teardown cycle during startup, where it
|
||||
// is common that the overlay system moves around nodes. Therefore, we make the
|
||||
// teardown async, so that it only happens when we are permanently disconnecting from dom
|
||||
|
|
@ -178,7 +181,6 @@ export const OverlayMixin = dedupeMixin(
|
|||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
}
|
||||
|
||||
get _overlayInvokerNode() {
|
||||
return Array.from(this.children).find(child => child.slot === 'invoker');
|
||||
|
|
|
|||
Loading…
Reference in a new issue