Components: Mat-Expansion-Panel in a Mat-Expansion-Panel closes parent on open.

Created on 9 May 2018  路  5Comments  路  Source: angular/components

Bug, feature request, or proposal:

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.

What is the expected behavior?

An expansion panel opening inside of another expansion panel should not make the parent panel close.

What are the steps to reproduce?

https://stackblitz.com/edit/angular-material2-issue-i4n6ry

What is the use-case or motivation for changing an existing behavior?

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular 6.0.0, Material 6.0.1

has pr

Most helpful comment

Adding

multi="true"

to your accordion fixes this behavior.

All 5 comments

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._

Was this page helpful?
0 / 5 - 0 ratings