You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
be able to tell Mat-dialog that it should not restore focus after it is closed. This can be passed as an option to mat-dialog.open(componentRef, {returnFocus:false})
What is the expected behavior?
Mat-Dialog doesn't try to return focus or manage focus
What is the current behavior?
"Once a dialog is closed, it will return focus to the element that was focused before the dialog was opened."
What are the steps to reproduce?
This is default behavior. Any mat-dialog behaves like this right now.
What is the use-case or motivation for changing an existing behavior?
I have a spinner/loading service. The spinner service is used like this
spinner.show(), spinner.hide(). Spinner service uses mat-dialog as internal implementation.
Usually, spinner.show() is called before page switch when a menu button is clicked. Spinner.hide() is called by the new page when data is ready.
My page has a directive similar to cdkFocusInitial. The directive puts focus into correct element in current page declaratively. However when data is ready and dialog is closed, mat-dialog returns focus to menu button.
If I can pass an option like this, dialog.open(spinner, {returnFocus: false} ), my directive will work properly. Page focus can be managed by directive.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
all
Is there anything else we should know?
None
The text was updated successfully, but these errors were encountered:
feature request
be able to tell Mat-dialog that it should not restore focus after it is closed. This can be passed as an option to mat-dialog.open(componentRef, {returnFocus:false})
What is the expected behavior?
Mat-Dialog doesn't try to return focus or manage focus
What is the current behavior?
"Once a dialog is closed, it will return focus to the element that was focused before the dialog was opened."
What are the steps to reproduce?
This is default behavior. Any mat-dialog behaves like this right now.
What is the use-case or motivation for changing an existing behavior?
I have a spinner/loading service. The spinner service is used like this
spinner.show(), spinner.hide(). Spinner service uses mat-dialog as internal implementation.
Usually, spinner.show() is called before page switch when a menu button is clicked. Spinner.hide() is called by the new page when data is ready.
My page has a directive similar to cdkFocusInitial. The directive puts focus into correct element in current page declaratively. However when data is ready and dialog is closed, mat-dialog returns focus to menu button.
If I can pass an option like this, dialog.open(spinner, {returnFocus: false} ), my directive will work properly. Page focus can be managed by directive.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
all
Is there anything else we should know?
None
The text was updated successfully, but these errors were encountered: