@@ -19,7 +19,7 @@ import {
19
19
ViewportRuler ,
20
20
} from '@angular/cdk/overlay' ;
21
21
import { Platform } from '@angular/cdk/platform' ;
22
- import { filter , startWith } from '@angular/cdk/rxjs' ;
22
+ import { filter , first , startWith } from '@angular/cdk/rxjs' ;
23
23
import {
24
24
AfterContentInit ,
25
25
Attribute ,
@@ -35,6 +35,7 @@ import {
35
35
InjectionToken ,
36
36
Input ,
37
37
isDevMode ,
38
+ NgZone ,
38
39
OnDestroy ,
39
40
OnInit ,
40
41
Optional ,
@@ -60,7 +61,7 @@ import {Observable} from 'rxjs/Observable';
60
61
import { merge } from 'rxjs/observable/merge' ;
61
62
import { Subject } from 'rxjs/Subject' ;
62
63
import { Subscription } from 'rxjs/Subscription' ;
63
- import { fadeInContent , transformPanel , transformPlaceholder } from './select-animations' ;
64
+ import { fadeInContent , transformPanel } from './select-animations' ;
64
65
import {
65
66
getMdSelectDynamicMultipleError ,
66
67
getMdSelectNonArrayValueError ,
@@ -295,7 +296,6 @@ export class MdSelect extends _MdSelectMixinBase implements AfterContentInit, On
295
296
/**
296
297
* Stream that emits whenever the state of the select changes such that the wrapping `MdFormField`
297
298
* needs to run change detection.
298
- * TODO(mmalerba): Call emit at appropriate times.
299
299
*/
300
300
stateChanges = new Subject < void > ( ) ;
301
301
@@ -428,6 +428,7 @@ export class MdSelect extends _MdSelectMixinBase implements AfterContentInit, On
428
428
private _viewportRuler : ViewportRuler ,
429
429
private _changeDetectorRef : ChangeDetectorRef ,
430
430
private _platform : Platform ,
431
+ private _ngZone : NgZone ,
431
432
renderer : Renderer2 ,
432
433
elementRef : ElementRef ,
433
434
@Optional ( ) private _dir : Directionality ,
@@ -487,6 +488,13 @@ export class MdSelect extends _MdSelectMixinBase implements AfterContentInit, On
487
488
this . _calculateOverlayPosition ( ) ;
488
489
this . _panelOpen = true ;
489
490
this . _changeDetectorRef . markForCheck ( ) ;
491
+
492
+ // Set the font size on the panel element once it exists.
493
+ first . call ( this . _ngZone . onStable ) . subscribe ( ( ) => {
494
+ if ( this . _triggerFontSize && this . overlayDir . overlayRef . overlayElement ) {
495
+ this . overlayDir . overlayRef . overlayElement . style . fontSize = `${ this . _triggerFontSize } px` ;
496
+ }
497
+ } ) ;
490
498
}
491
499
492
500
/** Closes the overlay panel and focuses the host element. */
0 commit comments