Skip to content

Commit

Permalink
Sidenav not visible when loaded as closed (#47)
Browse files Browse the repository at this point in the history
In a recent Angular Materials Update there is not only the visibility set when the Sidenav is displayed as closed, but it also gets a "display:none" set and that's why the Nav is not visible when first loading it as closed with this plugin. See: angular/components#24376 (comment)
  • Loading branch information
yoshi-dev authored Mar 25, 2022
1 parent 9e0a498 commit 7f1d20a
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export class MatDrawerRailDirective

this.drawer._closedStream.pipe(takeUntil(this.onDestory)).subscribe(() => {
this.renderer2.setStyle(this.el.nativeElement, 'visibility', 'visible');
this.renderer2.setStyle(this.el.nativeElement, 'display', 'block');
});

this.drawer.openedStart.pipe(takeUntil(this.onDestory)).subscribe(() => {
Expand All @@ -115,6 +116,7 @@ export class MatDrawerRailDirective
this.correctContentMargin(this.expandedWidth);
} else {
this.renderer2.setStyle(this.el.nativeElement, 'visibility', 'visible');
this.renderer2.setStyle(this.el.nativeElement, 'display', 'block');
this.closeMenu();
}
}
Expand Down

0 comments on commit 7f1d20a

Please sign in to comment.