mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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:
committed by
tinayuangao
parent
0c75643c7d
commit
4c638ec933
@@ -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>
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user