-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
We have a component in our app with a relatively complex layout involving a drawer nested inside a tab.
The drawer opens when user starts to edit an object and closes if they finish or cancel. Switching tabs mid-editing also cancels the operation, however in this scenario the drawer doesn't close properly and leaves behind an empty space inside the drawer container.
Reproduction
StackBlitz link: https://stackblitz.com/edit/i8ms9yfx?file=src%2Fexample%2Fexample.html
Steps to reproduce:
- Press "Toggle" to open the drawer
- Switch to the second tab
- Switch back to the first tab
Expected Behavior
Drawer should be fully closed, same as when pressing the Toggle button.
Actual Behavior
Drawer is stuck in some intermediate state, resulting in drawer-sized empty space being left behind
<mat-drawer-content>still hasmargin-leftequal to the drawer's width<mat-drawer>is stuck withmat-drawer-animating, from debugging it seems that thetransitionendevent which clears it never fires- part of it seems to be due to
mat-tab-grouphaving animations disabled; if I turn them back on, there's probably enough time for the drawer closing animation to finish
Opening the drawer, then closing without leaving the tab restores it to its normal state. Resizing the window also seems to cause the drawer to recalculate the space and remove it.
Environment
- Angular: 20.3.17, reproduced on 21.1.2
- CDK/Material: 20.2.14, reproduced on 21.1.2
- Browser(s): Chrome 146.0.7680.80 (Official Build) (64-bit), Firefox 148.0.2
- Operating System (e.g. Windows, macOS, Ubuntu): Fedora Linux, Windows