Skip to content

Commit 4c638ec

Browse files
devversiontinayuangao
authored andcommitted
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
1 parent 0c75643 commit 4c638ec

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/lib/dialog/OVERVIEW.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ let dialogRef = dialog.open(UserProfileComponent, {
1414
```
1515

1616
The `MdDialogRef` provides a handle on the opened dialog. It can be used to close the dialog and to
17-
recieve notification when the dialog has been closed.
17+
receive notification when the dialog has been closed.
18+
1819
```ts
1920
dialogRef.afterClosed.then(result => {
2021
console.log(`Dialog result: ${result}`); // Pizza!
@@ -37,3 +38,11 @@ Several directives are available to make it easier to structure your dialog cont
3738
| `<md-dialog-content>` | Primary scrollable content of the dialog |
3839
| `<md-dialog-actions>` | Container for action buttons at the bottom of the dialog |
3940
| `md-dialog-close` | \[Attr] Added to a `<button>`, makes the button close the dialog on click|
41+
42+
Once a dialog opens, the dialog will automatically focus the first tabbable element.
43+
44+
You can control which elements are tab stops with the `tabindex` attribute
45+
46+
```html
47+
<button md-button tabindex="-1">Not Tabbable</button>
48+
```

0 commit comments

Comments
 (0)