File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -283,13 +283,17 @@ export class CdkDialogContainer<C extends DialogConfig = DialogConfig>
283283 break ;
284284 case true :
285285 case 'first-tabbable' :
286- this . _focusTrap ?. focusInitialElementWhenReady ( ) . then ( focusedSuccessfully => {
287- // If we weren't able to find a focusable element in the dialog, then focus the dialog
288- // container instead.
289- if ( ! focusedSuccessfully ) {
290- this . _focusDialogContainer ( ) ;
291- }
292- } ) ;
286+ afterNextRender (
287+ ( ) => {
288+ const focusedSuccessfully = this . _focusTrap ?. focusInitialElement ( ) ;
289+ // If we weren't able to find a focusable element in the dialog, then focus the dialog
290+ // container instead.
291+ if ( ! focusedSuccessfully ) {
292+ this . _focusDialogContainer ( ) ;
293+ }
294+ } ,
295+ { injector : this . _injector } ,
296+ ) ;
293297 break ;
294298 case 'first-heading' :
295299 afterNextRender (
You can’t perform that action at this time.
0 commit comments