File tree 1 file changed +11
-7
lines changed
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>
283
283
break ;
284
284
case true :
285
285
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
+ ) ;
293
297
break ;
294
298
case 'first-heading' :
295
299
afterNextRender (
You can’t perform that action at this time.
0 commit comments