Closed
Description
Currently, the autoFocus
option of MatDialogConfig
is a boolean, with the values meaning:
false
- default value, focused therole="dialog
" elementtrue
- focuses the first tabbable element inside the dialog
This API is kind of confusing, since the dialog automatically focuses something regardless of what you do, so autoFocus: false
doesn't really make sense.
Instead, we should change autoFocus
to accept these values:
dialog
- focus therole="dialog"
elementfirst-tabbable
- focus the first tabbable elementfirst-header
- focus the first header (h1 - h6) element in the dialog. It's still an open question whether this should forcetabIndex = -1
.- A CSS selector- arbitrary CSS selector, the dialog would focus the first matching element (vis
querySelector
). Again an open question if this should forcetabIndex = -1
.