Skip to content

bug(sidenav): Focus trap is enabled with mode=side if there is another sidenav with mode=over or mode=push #32661

@aleoniz

Description

@aleoniz

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

Focus trap should not be enabled in MatSidenav when its mode=side. However, if there is another MatSidenav with mode=over or mode=push in the same MatSidenavContainer, focus trap is enabled. The stackblitz example provided comes from a example in the official documentation with changes that just include two buttons and change the mode of the second MatSidenav.

Reproduction

StackBlitz link
Steps to reproduce:

  1. Click in the button inside the sidenav
  2. Tab to try to get to the button outside the sidenav

Expected Behavior

The focus should move to the button outside of the sidenav

Actual Behavior

The focus remains on the button inside the sidenav

Environment

  • Angular: 21.0.0
  • CDK/Material: 21.0.0
  • Browser(s): Chrome 143.0.7499.193
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/sidenav

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions