angular / angular/components

bug(sidenav): Sidenav opening animation triggers on page navigation

Open
#33,080 1 comment 0 reactions 0 assignees View on GitHub
area: material/sidenav gemini-triaged P3
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

### 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

When using Angular Material’s Sidenav with `mode="side"` and `opened="true"`, navigating between pages triggers the opening animation, even though the sidenav is already in the open state. This behavior is inconsistent with the initial navigation, where the animation does not occur (which is the expected behavior).

### Reproduction

Steps to reproduce:
1. Go to https://material.angular.dev/components/sidenav/overview
2. Click on any link and go back to the previous page

### Expected Behavior

If the sidenav’s opened input is set to true initially, the opening animation should not play when moving between pages.

### Actual Behavior

The opening animation is triggered on page navigation, even if the sidenav is already open.

### Environment

- Angular: 21.2.6
- CDK/Material: 21.2.6
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows

Contributor guide

Open the contributing guide

Research direction

Start with the Angular Material Sidenav implementation and reproduce the behavior from the issue’s material.angular.dev steps using mode="side" and opened="true". Trace what happens during page navigation after the initial load, then verify that navigation no longer triggers the opening animation while the sidenav remains open.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.