forked from angular/components
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(drawer): allow for drawer container to auto-resize while open
Adds the `autosize` input that allows users to opt-in to drawers that auto-resize, similarly to the behavior before angular#6189. The behavior is off by default, because it's unnecessary for most use cases and can cause performance issues. Fixes angular#6743.
- Loading branch information
Showing
8 changed files
with
181 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/material-examples/sidenav-autosize/sidenav-autosize-example.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.example-container { | ||
width: 500px; | ||
height: 300px; | ||
border: 1px solid rgba(0, 0, 0, 0.5); | ||
} | ||
|
||
.example-sidenav-content { | ||
display: flex; | ||
height: 100%; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.example-sidenav { | ||
padding: 20px; | ||
} |
16 changes: 16 additions & 0 deletions
16
src/material-examples/sidenav-autosize/sidenav-autosize-example.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<mat-sidenav-container class="example-container" autosize> | ||
<mat-sidenav #sidenav class="example-sidenav" mode="side"> | ||
<p>Auto-resizing sidenav</p> | ||
<p *ngIf="showFiller">Lorem, ipsum dolor sit amet consectetur.</p> | ||
<button (click)="showFiller = !showFiller" mat-raised-button> | ||
Toggle extra text | ||
</button> | ||
</mat-sidenav> | ||
|
||
<div class="example-sidenav-content"> | ||
<button type="button" mat-button (click)="sidenav.toggle()"> | ||
Toggle sidenav | ||
</button> | ||
</div> | ||
|
||
</mat-sidenav-container> |
13 changes: 13 additions & 0 deletions
13
src/material-examples/sidenav-autosize/sidenav-autosize-example.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import {Component} from '@angular/core'; | ||
|
||
/** | ||
* @title Autosize sidenav | ||
*/ | ||
@Component({ | ||
selector: 'sidenav-autosize-example', | ||
templateUrl: 'sidenav-autosize-example.html', | ||
styleUrls: ['sidenav-autosize-example.css'], | ||
}) | ||
export class SidenavAutosizeExample { | ||
showFiller = false; | ||
} |