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', () => {
353
353
tooltipDirective . show ( ) ;
354
354
} ) . toThrowError ( 'Tooltip position "everywhere" is invalid.' ) ;
355
355
} ) ;
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
+ } ) ) ;
356
369
} ) ;
357
370
358
371
describe ( 'scrollable usage' , ( ) => {
Original file line number Diff line number Diff line change @@ -235,7 +235,9 @@ export class MdTooltip implements OnDestroy {
235
235
this . hide ( 0 ) ;
236
236
}
237
237
} ) ;
238
+
238
239
let config = new OverlayState ( ) ;
240
+ config . direction = this . _dir ? this . _dir . value : 'ltr' ;
239
241
config . positionStrategy = strategy ;
240
242
config . scrollStrategy =
241
243
new RepositionScrollStrategy ( this . _scrollDispatcher , SCROLL_THROTTLE_MS ) ;
You can’t perform that action at this time.
0 commit comments