1- import { Directive , ElementRef , Input , ViewContainerRef , OnDestroy } from '@angular/core' ;
1+ import {
2+ Directive , ElementRef , Input , ViewContainerRef , Optional , OnDestroy
3+ } from '@angular/core' ;
24import { Overlay , OverlayRef , OverlayState , TemplatePortal } from '../core' ;
35import { MdAutocomplete } from './autocomplete' ;
46import { PositionStrategy } from '../core/overlay/position/position-strategy' ;
57import { Observable } from 'rxjs/Observable' ;
68import { Subscription } from 'rxjs/Subscription' ;
79import 'rxjs/add/observable/merge' ;
10+ import { Dir } from '../core/rtl/dir' ;
811
912/** The panel needs a slight y-offset to ensure the input underline displays. */
1013export const MD_AUTOCOMPLETE_PANEL_OFFSET = 6 ;
@@ -27,7 +30,7 @@ export class MdAutocompleteTrigger implements OnDestroy {
2730 @Input ( 'mdAutocomplete' ) autocomplete : MdAutocomplete ;
2831
2932 constructor ( private _element : ElementRef , private _overlay : Overlay ,
30- private _viewContainerRef : ViewContainerRef ) { }
33+ private _viewContainerRef : ViewContainerRef , @ Optional ( ) private _dir : Dir ) { }
3134
3235 ngOnDestroy ( ) { this . _destroyPanel ( ) ; }
3336
@@ -95,6 +98,7 @@ export class MdAutocompleteTrigger implements OnDestroy {
9598 overlayState . width = this . _getHostWidth ( ) ;
9699 overlayState . hasBackdrop = true ;
97100 overlayState . backdropClass = 'md-overlay-transparent-backdrop' ;
101+ overlayState . direction = this . _dir ? this . _dir . value : 'ltr' ;
98102 return overlayState ;
99103 }
100104
0 commit comments