Components: Don't focus on first clickable element when opening a dialog

Created on 5 Dec 2017  路  2Comments  路  Source: angular/components

Bug, feature request, or proposal:

Bug

What is the expected behavior?

When opening a modal dialog (MatDialog) the first clickable element (anchor, input element, button etc.) shouldn't be focused automatically.

What is the current behavior?

The first clickable element within a dialog shouldn't be automatically selected when opening that dialog.

What are the steps to reproduce?

https://angular-ezhnx3.stackblitz.io

What is the use-case or motivation for changing an existing behavior?

Having the first element selected automatically in most cases isn't the expected behaviour, for example if a modal dialog only contains a "cancel" and a "confirm" button I don't want the "cancel" button (or whichever comes first) to be automatically focused.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular 5.0.2
Angular Material 5.0.0-rc0

Most helpful comment

Closing as this is working as expected. You can control the autoFocus state using the MatDialogConfig

All 2 comments

Closing as this is working as expected. You can control the autoFocus state using the MatDialogConfig

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

crutchcorn picture crutchcorn  路  3Comments

jelbourn picture jelbourn  路  3Comments

kara picture kara  路  3Comments

vitaly-t picture vitaly-t  路  3Comments

Miiekeee picture Miiekeee  路  3Comments