Skip to content

(feature) expansion panel: secondary content & description alignment #5173

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

Closed
mattheiler opened this issue Jun 16, 2017 · 9 comments
Closed
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix needs: discussion Further discussion with the team is needed before proceeding

Comments

@mattheiler
Copy link

Bug, feature request, or proposal:

Feature.

What is the expected behavior?

Secondary content is supported by expansion panel header.
The descriptions should line up.
GUIDELINES

What is the current behavior?

Expansion panel has a fixed height and line height. Secondary content is not supported.
The descriptions don't line up.

What are the steps to reproduce?

ROUGH EXAMPLE

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

Support secondary content.
Align descriptions in a column.

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

@angular/material 2.0.0-beta.6-*

@mattheiler mattheiler changed the title feature: expansion panel spec doesn't match guidelines feature: expansion panel secondary content & description alignment Jun 16, 2017
@mattheiler mattheiler changed the title feature: expansion panel secondary content & description alignment (feature) expansion panel: secondary content & description alignment Jun 16, 2017
@julianobrasil
Copy link
Contributor

julianobrasil commented Jun 17, 2017

Maybe adding flex-basis: 0 to mat-expansion-panel-header-title and mat-expansion-panel-header-description could fix the alignment (or replacing flex-grow: X by just flex: X)

@jelbourn jelbourn added discussion feature This issue represents a new feature or feature request rather than a bug or bug fix labels Jun 20, 2017
@mattheiler
Copy link
Author

Using flex layout and assigning fxFlex="50%" to the title fixes the alignment issue. However, still cant display secondary content, as of beta 8.

@dmitrysteblyuk
Copy link

Does anybody managed to come up with a workaround?
I guess the problem here is with expansionHeight trigger for MdExpansionPanelHeader, which sets fixed line-height and height styles. I tried to override them using css !important flag and was quite surprised to find out it doesn't work during animation.

@julianobrasil
Copy link
Contributor

julianobrasil commented Aug 25, 2017

@dmitrysteblyuk, if you're using a <md-accordion> try this:

<md-accordion class="my-headers-align">

in the component css class:

.my-headers-align .mat-expansion-panel-header-title, 
.my-headers-align .mat-expansion-panel-header-description {
  flex-basis: 0;
}

Or, to set it globally, just ommit the .my-headers-align part in styles.css:

.mat-expansion-panel-header-title, 
.mat-expansion-panel-header-description {
  flex-basis: 0;
}

@BojanKogoj
Copy link

BojanKogoj commented Jan 16, 2020

If one element has hideToggle and the other one doesn't it won't be aligned. One of .mat-content will be smaller than the other because of the indicator.

image

Hackish solution for that (add toggle-fix to mat-expansion-panel with hideToggle)

.toggle-fix .mat-content {
  padding-right: 8px;
}

@mmalerba mmalerba added needs: discussion Further discussion with the team is needed before proceeding and removed discussion labels Mar 3, 2020
@jelbourn
Copy link
Member

Closing this since I believe it's something the application can do with CSS.

@thw0rted
Copy link

Well, maybe the application can do this with CSS, but the current version of the spec does codify some of the spacing involved, so I would make the argument that full support from the component for multi-part headers would make spec compliance more likely.

The weird part is that it specifies the space between "parts" of the header, but doesn't specify how the parts are defined. Clearly the block width of the first and third examples (with two and three blocks per header, respectively) is not the native / inline width of the text itself, but it's also not divided evenly into halves or thirds. I guess if the application has to decide on some fixed rule for how the headers get divided, and the spec has nothing to say about it, maybe there's nothing the component can do?

@jelbourn
Copy link
Member

jelbourn commented May 6, 2020

Yeah, this is a case where the spec's under-specification leads me to believe the examples aren't intended to be normative.

@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 Jun 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix needs: discussion Further discussion with the team is needed before proceeding
Projects
None yet
Development

No branches or pull requests

7 participants