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

mat-card-lg-image (mat-card-title-group) overlaps content in mat-card-content #10031

Closed
sumpton opened this issue Feb 20, 2018 · 6 comments · Fixed by #12205
Closed

mat-card-lg-image (mat-card-title-group) overlaps content in mat-card-content #10031

sumpton opened this issue Feb 20, 2018 · 6 comments · Fixed by #12205
Assignees
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@sumpton
Copy link

sumpton commented Feb 20, 2018

Bug, feature request, or proposal:

bug -- unless I am missing something

The large image mat-card-lg-image
in a mat-card-title-group overlaps the text below (mat-card-content).

What is the expected behavior?

The CSS should separate the image from the text in mat-card-content.

What is the current behavior?

The image overlaps the content in mat-card-content.

What are the steps to reproduce?

Providing a StackBlitz reproduction is the best way to share your issue.

StackBlitz starter: https://goo.gl/wwnhMV

https://angular-jqxhux.stackblitz.io

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

:)

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

Those in the current StackBlitz linked from
https://material.angular.io/components/card/examples

Is there anything else we should know?

@surfer19
Copy link

https://angular-jqxhux.stackblitz.io Link is not working :)

@josephperrott
Copy link
Member

The mat-card-lg-image selector should only be used inside of a <mat-card-title-group> element. I am unsure if this is the cause of the issue, but I think that the documentation may need to be updated to make it a bit more clear.

@jelbourn jelbourn assigned devversion and unassigned jelbourn Feb 21, 2018
@jelbourn jelbourn added the needs investigation A member of the team needs to do further investigation to determine the root cause label Feb 21, 2018
@sumpton
Copy link
Author

sumpton commented Feb 21, 2018

I guess I don't know how to work stackblitz. I don't know where I errored.

I went to
https://material.angular.io/components/card/examples
https://stackblitz.com/angular/ymlanaykbdm

There I copied lines 1 - 19 as a starting point.

  • changed mat-card-header to mat-card-title-group
  • deleted mat-card-avatar
  • moved mat-card-image into mat-card-title-group
  • changed that to mat-card-lg-image

end up with

<mat-card-title-group>
    <div mat-card-avatar class="example-header-image"></div>
    <mat-card-title>Shiba Inu</mat-card-title>
    <mat-card-subtitle>Dog Breed</mat-card-subtitle>
    <img mat-card-lg-image src="https://material.angular.io/assets/img/examples/shiba2.jpg" alt="Photo of a Shiba Inu">
</mat-card-title-group>

that the "lg" image is overlapping the first line of mat-card-content text.

I just did it again, and I have no confidence this works for others:

https://ymlanaykbdm.angular.stackblitz.io

@sumpton
Copy link
Author

sumpton commented Feb 28, 2018

Please see if this stackblitz link works -- and demonstrates the CSS problem with the mat-card-lg-image overlapping mat-card-content.

https://stackblitz.com/edit/angular-jqxhux

@KevinKoelzer
Copy link

@sumpton The easiest thing to do might be to add a "style='margin-bottom: auto'" to the first image?

@devversion devversion added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed needs investigation A member of the team needs to do further investigation to determine the root cause labels Jul 14, 2018
devversion added a commit to devversion/material2 that referenced this issue Jul 14, 2018
* Fixes that `mat-card-$breakpoint-image` images overlap the card content when placed inside of the title group.

Fixes angular#10031
jelbourn pushed a commit that referenced this issue Aug 23, 2018
* Fixes that `mat-card-$breakpoint-image` images overlap the card content when placed inside of the title group.

Fixes #10031
jelbourn pushed a commit that referenced this issue Aug 23, 2018
* Fixes that `mat-card-$breakpoint-image` images overlap the card content when placed inside of the title group.

Fixes #10031
jelbourn pushed a commit that referenced this issue Aug 29, 2018
* Fixes that `mat-card-$breakpoint-image` images overlap the card content when placed inside of the title group.

Fixes #10031
@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 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants