File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -353,6 +353,19 @@ describe('MdTooltip', () => {
353353 tooltipDirective . show ( ) ;
354354 } ) . toThrowError ( 'Tooltip position "everywhere" is invalid.' ) ;
355355 } ) ;
356+
357+ it ( 'should pass the layout direction to the tooltip' , fakeAsync ( ( ) => {
358+ dir . value = 'rtl' ;
359+
360+ tooltipDirective . show ( ) ;
361+ tick ( 0 ) ;
362+ fixture . detectChanges ( ) ;
363+
364+ const tooltipWrapper = overlayContainerElement . querySelector ( '.cdk-overlay-pane' ) ;
365+
366+ expect ( tooltipWrapper ) . toBeTruthy ( 'Expected tooltip to be shown.' ) ;
367+ expect ( tooltipWrapper . getAttribute ( 'dir' ) ) . toBe ( 'rtl' , 'Expected tooltip to be in RTL mode.' ) ;
368+ } ) ) ;
356369 } ) ;
357370
358371 describe ( 'scrollable usage' , ( ) => {
Original file line number Diff line number Diff line change @@ -235,7 +235,9 @@ export class MdTooltip implements OnDestroy {
235235 this . hide ( 0 ) ;
236236 }
237237 } ) ;
238+
238239 let config = new OverlayState ( ) ;
240+ config . direction = this . _dir ? this . _dir . value : 'ltr' ;
239241 config . positionStrategy = strategy ;
240242 config . scrollStrategy =
241243 new RepositionScrollStrategy ( this . _scrollDispatcher , SCROLL_THROTTLE_MS ) ;
You can’t perform that action at this time.
0 commit comments