docs(dialog): explain how to disable auto-focus for elements (#2596)

* docs(dialog): explain how to disable auto-focus for elements

* Explains that the dialog auto-focuses elements, which are tabbable for the user
* Also adds a small example for disabling the auto-focus on specific elements

Closes #2533

* Address comment
This commit is contained in:
Paul Gschwendtner
2017-01-12 22:26:25 +01:00
committed by tinayuangao
parent 0c75643c7d
commit 4c638ec933
+10 -1
View File
@@ -14,7 +14,8 @@ let dialogRef = dialog.open(UserProfileComponent, {
```
The `MdDialogRef` provides a handle on the opened dialog. It can be used to close the dialog and to
recieve notification when the dialog has been closed.
receive notification when the dialog has been closed.
```ts
dialogRef.afterClosed.then(result => {
console.log(`Dialog result: ${result}`); // Pizza!
@@ -37,3 +38,11 @@ Several directives are available to make it easier to structure your dialog cont
| `<md-dialog-content>` | Primary scrollable content of the dialog |
| `<md-dialog-actions>` | Container for action buttons at the bottom of the dialog |
| `md-dialog-close` | \[Attr] Added to a `<button>`, makes the button close the dialog on click|
Once a dialog opens, the dialog will automatically focus the first tabbable element.
You can control which elements are tab stops with the `tabindex` attribute
```html
<button md-button tabindex="-1">Not Tabbable</button>
```