fix(sidenav): not positioning correctly in rtl (#12741)

Adds a workaround for a Chrome issue where the sidenav content is partially cut off when `dir='rtl'` is set on the `body` or `html` nodes.
This commit is contained in:
Kristiyan Kostadinov
2018-09-14 15:54:01 +02:00
committed by Jeremy Elbourn
parent 5d1643abce
commit 9d3d95f9e2
4 changed files with 16 additions and 2 deletions
+3
View File
@@ -0,0 +1,3 @@
<div class="mat-drawer-inner-container">
<ng-content></ng-content>
</div>
+11
View File
@@ -162,6 +162,17 @@ $mat-drawer-over-drawer-z-index: 4;
}
}
// Note that this div isn't strictly necessary on all browsers, however we need it in
// order to avoid a layout issue in Chrome. The issue is that in RTL mode the browser doesn't
// account for the sidenav's scrollbar while positioning, which ends up pushing it partially
// out of the screen. We work around the issue by having the scrollbar be on this inner container.
.mat-drawer-inner-container {
width: 100%;
height: 100%;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
.mat-sidenav-fixed {
position: fixed;
}
+1 -1
View File
@@ -103,7 +103,7 @@ export class MatDrawerContent extends CdkScrollable implements AfterContentInit
moduleId: module.id,
selector: 'mat-drawer',
exportAs: 'matDrawer',
template: '<ng-content></ng-content>',
templateUrl: 'drawer.html',
animations: [matDrawerAnimations.transformDrawer],
host: {
'class': 'mat-drawer',
+1 -1
View File
@@ -54,7 +54,7 @@ export class MatSidenavContent extends MatDrawerContent {
moduleId: module.id,
selector: 'mat-sidenav',
exportAs: 'matSidenav',
template: '<ng-content></ng-content>',
templateUrl: 'drawer.html',
animations: [matDrawerAnimations.transformDrawer],
host: {
'class': 'mat-drawer mat-sidenav',