components icon indicating copy to clipboard operation
components copied to clipboard

bug(MatExpansionPanel): not respecting expanded property / mat-menu forcing panels to close

Open Venipa opened this issue 3 years ago • 6 comments

Reproduction

https://stackblitz.com/edit/components-issue-pj9d3a?file=src%2Fapp%2Fexample-component.html

Steps to reproduce:

  1. mat menu
  2. mat-accordion with panel elements with some of them expanded from the start
  3. open menu
  4. all panels are open/expanded
  5. close menu
  6. reopen menu
  7. all expanded panels are now closed

Expected Behavior

What behavior were you expecting to see? expanded panel after reopening mat-menu

Actual Behavior

What behavior did you actually see? closes any expanded panel after reopening mat-menu

Environment

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

Venipa avatar Sep 09 '20 09:09 Venipa

according to the behavior the expanded property is still respected except for the content. the content is "not loaded/rendered" but it is "expanded"

Venipa avatar Sep 11 '20 13:09 Venipa

My bet is this is due to the menu blocking child animations while it's animating since the expanded/collapsed state of the accordion depends on an animation. It can be seen on repeat opens since the current release has a bug where the menu only animates on the first open: note how the first time it's closed, the accordion gets collapsed, but then it's fine if you keep opening and closing it.

crisbeto avatar Sep 13 '20 11:09 crisbeto

My guess it's a cdk issue, tried making an own menu but it still happened

Venipa avatar Sep 14 '20 00:09 Venipa

note how the first time it's closed, the accordion gets collapsed, but then it's fine if you keep opening and closing it.

I've got exact same problem. First of all, accordions are closed on the first focusout from mat menu, and then the first opening/closing is without animations. Also accordion opens on the second click (just the first time).

Any updates on that issue?

szymonlisiecki avatar Apr 20 '22 08:04 szymonlisiecki

I have the same problem. Any updates on that issue?

Bobbitoo avatar Nov 22 '23 12:11 Bobbitoo

I have the same problem. Any updates on this issue? :(

rakshitongit avatar Feb 22 '24 09:02 rakshitongit