-
Notifications
You must be signed in to change notification settings - Fork 6.8k
feat(sidenav): add responsive sidenav #6525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* Add responsive sidenav * Close and open depending on width Fix #1130
* Used window width instead of element width
* Note that this only works when the window is rezied. | ||
* If you resize it some other way, call checkBreakpoint(). | ||
*/ | ||
@HostListener('window:resize', ['$event']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be debounced. See https://github.com/angular/material2/blob/master/src/lib/tabs/tab-header.ts#L182-L195
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also thanks for putting this together! I've personally been really looking forward to it.
checkBreakpoint() { | ||
if (this._element.nativeElement.offsetWidth < this.breakpointWidth) { | ||
if (this.breakpointChangeMode) | ||
this._sidenavs.forEach(sidenav => sidenav.mode = "over"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use curly braces here and below
Starting new branch because of drawer/sidenav being split. |
New version: #6535 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Fix #1130