Skip to content

Commit 7cae90a

Browse files
committed
fix(overlay): restore previous host element before attaching
1 parent ab0f30d commit 7cae90a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/cdk/overlay/overlay-ref.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,15 @@ export class OverlayRef implements PortalOutlet, OverlayReference {
114114
attach(portal: Portal<any>): any {
115115
let attachResult = this._portalOutlet.attach(portal);
116116

117-
if (this._positionStrategy) {
118-
this._positionStrategy.attach(this);
119-
}
120-
121117
// Update the pane element with the given configuration.
122118
if (!this._host.parentElement && this._previousHostParent) {
123119
this._previousHostParent.appendChild(this._host);
124120
}
125121

122+
if (this._positionStrategy) {
123+
this._positionStrategy.attach(this);
124+
}
125+
126126
this._updateStackingOrder();
127127
this._updateElementSize();
128128
this._updateElementDirection();

0 commit comments

Comments
 (0)