Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion goldens/material/dialog/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export class MatDialogConfig<D = any> {
minWidth?: number | string;
panelClass?: string | string[];
position?: DialogPosition;
restoreFocus?: boolean;
restoreFocus?: boolean | string | HTMLElement;
role?: DialogRole;
scrollStrategy?: ScrollStrategy;
viewContainerRef?: ViewContainerRef;
Expand Down
10 changes: 7 additions & 3 deletions src/material/dialog/dialog-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,14 @@ export class MatDialogConfig<D = any> {
autoFocus?: AutoFocusTarget | string | boolean = 'first-tabbable';

/**
* Whether the dialog should restore focus to the
* previously-focused element, after it's closed.
* Whether the dialog should restore focus to the previously-focused element upon closing.
* Has the following behavior based on the type that is passed in:
* - `boolean` - when true, will return focus to the element that was focused before the dialog
* was opened, otherwise won't restore focus at all.
* - `string` - focus will be restored to the first element that matches the CSS selector.
* - `HTMLElement` - focus will be restored to the specific element.
*/
restoreFocus?: boolean = true;
restoreFocus?: boolean | string | HTMLElement = true;

/** Whether to wait for the opening animation to finish before trapping focus. */
delayFocusTrap?: boolean = true;
Expand Down