With Material 6.0.1, I've noticed that when an expansion panel placed inside for another expansion-panel is opened, the parent expansion panel closes immediately. This was not the case with prior versions.
An expansion panel opening inside of another expansion panel should not make the parent panel close.
https://stackblitz.com/edit/angular-material2-issue-i4n6ry
Angular 6.0.0, Material 6.0.1
Adding
multi="true"
to your accordion fixes this behavior.
Please have a look at the code. The issue does not concern accordions, but instead expansion panels placed in the body of another expansion panel.
I honestly don't know how to use stackblitz, but I tried to fork it with multi="true" for you in the accordion. Does this not resolve your issue of it closing it's parent?
https://stackblitz.com/edit/angular-material2-issue-hjupgw?file=app/app.component.html
Removing the expansion panels from the mat-accordion component would also fix this behavior.
It is true that adding "multi" to the parent makes the inner mat-expansion-panel work, but I'm not sure this is wanted behaviour. Shouldn't the child expansion-panel or child accordion operate by its own set of rules? I don't think the parent accordion should define the child accordion's behaviour.
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
Adding
multi="true"to your accordion fixes this behavior.