bug(MatDialog): with 'autoFocus: false' lacks focus trap after angular/[email protected]/9.2.2 #19246
Closed
Description
Reproduction
Steps to reproduce:
- Add
autoFocus: false
to any matDialog stackblitz example with a tabbable element. - Tab through and see focus goes beyond the dialog
Expected Behavior
Expected behavior can be seen with the use of @angular/[email protected]. The focus trap div is correctly added and tabbing with the dialog open, keeps the focus inside the dialog. Automatically added focus trap div:
<div tabindex="0" class="cdk-visually-hidden cdk-focus-trap-anchor" aria-hidden="true"></div>
Actual Behavior
The div above is nowhere to be seen with angular/[email protected] or 9.2.2, and consevently lets focus move beyond and outside the dialog.
Environment
- Angular/Material: 9.2.1
- Browser(s): Chrome, IE, Edge (any)
- Operating System: Windows