Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expansion panel open by default #6962

Closed
ImranAhmed opened this issue Sep 10, 2017 · 12 comments
Closed

Expansion panel open by default #6962

ImranAhmed opened this issue Sep 10, 2017 · 12 comments

Comments

@ImranAhmed
Copy link

Bug, feature request, or proposal:

I've been searching for a way to open the open expansion panel by default, very little in the documentations, is this possible or shall we raise as a feature request?

@ppham27
Copy link
Contributor

ppham27 commented Sep 10, 2017

You can do:

<md-expansion-panel [expanded]="true">
  <!-- Your content here. -->
</md-expansion-panel>

@ImranAhmed
Copy link
Author

Thanks, perfect!

@ted-sandbox
Copy link

easy peasy, thanks for the tip.

@ORESoftware
Copy link
Contributor

doesn't that mean it's always expanded? or just initially expanded?

@DukeCaesar
Copy link

Adding [expanded]="true" to mat-expansion-panel will expand the panel initially. You can still collapse it when you click the toggle header.

@pcnate
Copy link

pcnate commented Jul 26, 2018

is this documented on http://material.angular.io?

@aloketewary
Copy link

aloketewary commented Aug 13, 2018

Yes in API there is @ Input part where you can see it. Follow the docs @pcnate
https://v5.material.angular.io/components/expansion/api#MatExpansionPanel

@YuvrajSagarRana
Copy link

how to open mat-expansion in upward direction?

@bullcrane
Copy link

bullcrane commented Nov 24, 2018

Since merely assigning true, rather than doing anything to it programmatically, this also works:

<md-expansion-panel expanded>
  <!-- Your content here. -->
</md-expansion-panel>

@yannanna0920
Copy link

如果是循环md-expansion-panel呢 这样加expanded 会报错 也只默认最后一个是展开的 有遇到这种情况德吗(What if it's a loop called md-expansion panel so expanded will report an error and it will simply expand the last one by default. Is that the case)

@hirocsingh
Copy link

hirocsingh commented Jul 30, 2019

How can I expand all the expansion-panel by default? [expanded]="true" only works for one panel whichever is the latest.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests