When we place button inside angular material dialog it is auto focussing first button in that modal.
Asked
Active
Viewed 7,653 times
10
-
1you can add "tabIndex=-1" to each button – Eliseo Feb 12 '19 at 07:53
1 Answers
19
You can add the autofocus = false
properties to the dialog to disable the auto focus.
Example as below:
const dialogRef = this.dialog.open(DialogOverviewExampleDialog, {
width: '250px',
data: {name: this.name, animal: this.animal},
autoFocus: false
});

Khai Kiong
- 371
- 2
- 13
-
The word `autofocus` in the phrase`autofocus = false` should be `autoFocus`. The letter f should be capitalized. – Duke Caesar Oct 10 '22 at 18:34