Skip to content

Responsive sidenav doesn't update focus trap #16601

Closed
@phyrephox

Description

@phyrephox

Reproduction

Use StackBlitz to reproduce your issue: https://stackblitz.com/edit/angular-lkt2qw

Steps to reproduce:

  1. Open the sidenav with the hamburger menu
  2. Shrink the stackblitz preview window until it switches to 'over' mode
  3. 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.

Metadata

Metadata

Assignees

Labels

GThis is is related to a Google internal issueP3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions