Uh oh!
There was an error while loading. Please reload this page.
docs(drawer): Add additional documentation for disableClose - #6750
Conversation
mmalerba
commented
Sep 6, 2017
@willshowell you mentioned in #6427 that dialog already does something like this? Do you know what the Observable is called? I'd like to keep it consistent across components |
willshowell
commented
Sep 6, 2017
@mmalerba it hasn't yet been merged but it will be a generic It was @jelbourn's opinion (#3460 (comment)) that the consumer can filter for desired keys, but that may have only been because overlay is very generic. |
g1shin
commented
Sep 6, 2017
@mmalerba Would you recommend changing |
mmalerba
commented
Sep 6, 2017
I actually wonder if we even need it for sidenav, it seems like its just a proxy for <md-drawer-container(backdropClick)="customBackdropClickHandler()"><md-drawerdisableClose(keydown)="customKeydownHandler($event)"></md-drawer></md-drawer-container> |
g1shin
commented
Sep 6, 2017
Reverted changes made to |
| ### Sidenav vs. Drawer | ||
| The difference between sidenav and drawer is that the sidenav takes up fullscreen whereas drawer is a smaller element | ||
| that takes up a subsection of the screen. `md-sidenav` has to be placed inside `md-sidenav-container` and `md-drawer` | ||
| has to be placed inside `md-drawer-container`. More functionalities will be added to sidenav in the future. |
There was a problem hiding this comment.
For the last sentence how about:
Currently `md-drawer` and `md-sidenav`support all the same features. However in the future we expect to add different features specific to the different use cases.| For a sidenav with a FAB (Floating Action Button) or other floating element, the recommended approach is to place the FAB | ||
| outside of the scrollable region and absolutely position it. | ||
| ### Sidenav vs. Drawer |
There was a problem hiding this comment.
I would put this at the top since its important context that users need to understand the rest of the docs (that all the stuff we're saying about sidenavs also applies to drawer
| ### Disabling closing of sidenav and drawer | ||
| By default, sidenav and drawer can be closed either by clicking on the backdrop or by pressing <kbd>ESCAPE</kbd>. | ||
| `disableClose` attribute can be set on `md-drawer` or `md-sidenav` to disable closing by two methods. To enable one |
There was a problem hiding this comment.
The disableClose attribute
"closing by two methods" --> "automatic closing when the backdrop is clicked or the escape key is pressed"
| ### Disabling closing of sidenav and drawer | ||
| By default, sidenav and drawer can be closed either by clicking on the backdrop or by pressing <kbd>ESCAPE</kbd>. | ||
| `disableClose` attribute can be set on `md-drawer` or `md-sidenav` to disable closing by two methods. To enable one | ||
| of the two methods to allow closing with `disableClose` attribute set, then custom event handlers can be used as below: |
There was a problem hiding this comment.
To add custom logic on backdrop click, add a (backdropClick) listener to the md-sidenav-container. For custom escape key logic, a standard (keydown) listener will suffice.
| `disableClose` attribute can be set on `md-drawer` or `md-sidenav` to disable closing by two methods. To enable one | ||
| of the two methods to allow closing with `disableClose` attribute set, then custom event handlers can be used as below: | ||
| ```html | ||
| <md-drawer-container (backdropClick)="customBackdropClickHandler()"> |
There was a problem hiding this comment.
Since every other example in this doc uses sidenav, lets use sidenav. The new explainer about sidenav vs drawer will let people know they can use either
g1shin
commented
Sep 7, 2017
Comments have been addressed 👍 Ready for review |
| See the section on positioning below. | ||
| ### Sidenav vs. Drawer |
There was a problem hiding this comment.
I wouldn't make this a separate section, just part of the section above. It also needs to be worded to introduce the drawer, otherwise us: "The difference between sidenav and drawer..." user: "wait, what's drawer?"
g1shin
commented
Sep 8, 2017
Changes have been made 😃 |
| `<md-sidenav>` elements, each must be placed on a different side of the container. | ||
| See the section on positioning below. | ||
| `<md-drawer>` is a component that is similar to `<md-sidenav>`. |
There was a problem hiding this comment.
On second thought I'll just add some documentation on md-drawer later, for now lets not mention it since its the exact same thing as md-sidenav
| ### Disabling closing of sidenav and drawer | ||
| By default, sidenav and drawer can be closed either by clicking on the backdrop or by pressing <kbd>ESCAPE</kbd>. | ||
| The `disableClose` attribute can be set on `md-drawer` or `md-sidenav` to disable automatic closing when the backdrop |
g1shin
commented
Sep 8, 2017
Removed everything related to |
| By default, sidenav can be closed either by clicking on the backdrop or by pressing <kbd>ESCAPE</kbd>. | ||
| The `disableClose` attribute can be set on `md-sidenav` to disable automatic closing when the backdrop | ||
| is clicked or <kbd>ESCAPE</kbd> is pressed. To add custom logic on backdrop click, add a `(backdropClick)` listener to | ||
| `md-sidenav-container`. For custom <kdb>ESCAPE</kbd> logic, a standard `(keydown)` listener will suffice. |
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. |
ESCAPEkeydown is exposed as an event to support various cases.Fixes#6427