Skip to content

Commit 4e0364a

Browse files
authored
fix(overlay): restore previous host element before attaching
1 parent ab0f30d commit 4e0364a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/cdk/overlay/overlay-ref.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,16 @@ export class OverlayRef implements PortalOutlet, OverlayReference {
113113
*/
114114
attach(portal: Portal<any>): any {
115115
let attachResult = this._portalOutlet.attach(portal);
116-
117-
if (this._positionStrategy) {
118-
this._positionStrategy.attach(this);
119-
}
120-
116+
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)