@@ -20,6 +20,7 @@ import {
20
20
Inject ,
21
21
InjectionToken ,
22
22
Input ,
23
+ NgZone ,
23
24
OnDestroy ,
24
25
OnInit ,
25
26
Optional ,
@@ -35,7 +36,7 @@ import {DOWN_ARROW, END, ENTER, HOME, SPACE, UP_ARROW} from '@angular/cdk/keycod
35
36
import { FocusKeyManager } from '@angular/cdk/a11y' ;
36
37
import { Directionality } from '@angular/cdk/bidi' ;
37
38
import { coerceBooleanProperty } from '@angular/cdk/coercion' ;
38
- import { filter , startWith } from '@angular/cdk/rxjs' ;
39
+ import { filter , first , startWith } from '@angular/cdk/rxjs' ;
39
40
import {
40
41
ConnectedOverlayDirective ,
41
42
Overlay ,
@@ -281,7 +282,6 @@ export class MdSelect extends _MdSelectMixinBase implements AfterContentInit, On
281
282
/**
282
283
* Stream that emits whenever the state of the select changes such that the wrapping `MdFormField`
283
284
* needs to run change detection.
284
- * TODO(mmalerba): Call emit at appropriate times.
285
285
*/
286
286
stateChanges = new Subject < void > ( ) ;
287
287
@@ -405,6 +405,7 @@ export class MdSelect extends _MdSelectMixinBase implements AfterContentInit, On
405
405
private _viewportRuler : ViewportRuler ,
406
406
private _changeDetectorRef : ChangeDetectorRef ,
407
407
private _platform : Platform ,
408
+ private _ngZone : NgZone ,
408
409
renderer : Renderer2 ,
409
410
elementRef : ElementRef ,
410
411
@Optional ( ) private _dir : Directionality ,
@@ -475,6 +476,13 @@ export class MdSelect extends _MdSelectMixinBase implements AfterContentInit, On
475
476
this . _calculateOverlayPosition ( ) ;
476
477
this . _panelOpen = true ;
477
478
this . _changeDetectorRef . markForCheck ( ) ;
479
+
480
+ // Set the font size on the panel element once it exists.
481
+ first . call ( this . _ngZone . onStable ) . subscribe ( ( ) => {
482
+ if ( this . _triggerFontSize && this . overlayDir . overlayRef . overlayElement ) {
483
+ this . overlayDir . overlayRef . overlayElement . style . fontSize = `${ this . _triggerFontSize } px` ;
484
+ }
485
+ } ) ;
478
486
}
479
487
480
488
/** Closes the overlay panel and focuses the host element. */
0 commit comments