Closed
Description
Reproduction
Use StackBlitz to reproduce your issue: https://stackblitz.com/edit/angular-lkt2qw
Steps to reproduce:
- Open the sidenav with the hamburger menu
- Shrink the stackblitz preview window until it switches to 'over' mode
- Tab through the sidenav
Expected Behavior
As the sidenav is now in over mode, the focus trap should be enabled.
Actual Behavior
The focus trap is not enabled so the user can tab past the sidenav into the main content.
This also happens in reverse, when opening the sidenav in over mode and switching to side mode. The focus trap remains enabled even though the user should be able to tab away from the sidenav.
Environment
- Angular: 8.x
- CDK/Material: 8.x
- Browser(s): Tested in chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Ubuntu, ChromeOS
I think the issue is this line, where the focus trap is only updated on open/close, rather than mode change as well.