Skip to content

Commit b2225e2

Browse files
committed
fix: offset changes not being deteched in md-select
1 parent 5d0e3d7 commit b2225e2

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/lib/core/overlay/overlay-directives.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export class ConnectedOverlayDirective implements OnDestroy, OnChanges {
179179

180180
ngOnChanges(changes: SimpleChanges) {
181181
if (changes['open']) {
182-
changes['open'].currentValue ? this._attachOverlay() : this._detachOverlay();
182+
this.open ? this._attachOverlay() : this._detachOverlay();
183183
}
184184
}
185185

src/lib/select/select.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,10 @@ export class MdSelect implements AfterContentInit, OnDestroy, OnInit, ControlVal
748748
}
749749

750750
this._checkOverlayWithinViewport(maxScroll);
751+
752+
// Change detection needs to be triggered in order for
753+
// the overlay's position to get updated in time.
754+
this._changeDetectorRef.detectChanges();
751755
}
752756

753757
/**

0 commit comments

Comments
 (0)