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

The ripple causes strange margin - reproduced #14981

Closed
kfrankiewicz opened this issue Jan 28, 2019 · 2 comments
Closed

The ripple causes strange margin - reproduced #14981

kfrankiewicz opened this issue Jan 28, 2019 · 2 comments

Comments

@kfrankiewicz
Copy link

kfrankiewicz commented Jan 28, 2019

Related issues:
#10898
#12210

The ripple creates strange margins, when position: relative is added to the children divs in the global CSS. The recent angular versions. In my case I used mat-tab-group with the ripple.

It causes this problem:

https://stackblitz.com/edit/angular-m5y3yx?file=src%2Fapp%2Fapp.component.html

It seems the position: absolute (or whatever it is) from the ripple is overwritten by the global position.

The ripple works well when I add this globally:

div.mat-ripple-element {
  position: absolute !important;
}
@kfrankiewicz kfrankiewicz changed the title The ripple causes strange margin The ripple causes strange margin - reproduced Jan 28, 2019
kfrankiewicz added a commit to kfrankiewicz/material2 that referenced this issue Jan 28, 2019
@devversion
Copy link
Member

devversion commented Jan 28, 2019

Hi @kfrankiewicz, thanks for your issue!

The matRipple is internally used by a lot of Angular Material components, but I realize there are a few use-cases where the matRipple does not work as expected. Though the ripple is more intended to be used in advanced cases, where other surrounding element styles are properly overwritten so that the ripple can behave properly.

Most of the time ripples can be launched safely by creating an absolute overlapping transparent container that acts as the ripple container and does not affect the parent elements. this can be seen in the lib/button implementation for reference.

Also, I commented on your proposal #14982. Let's track this issue for compatibility with the <mat-card> in the existing issue #10898. Thanks!

We can also have an issue for the tab-group compatibility, but we need to figure out if we actually want to guarantee that every Material component is working fine with additional custom ripples. Developers should be always able to properly use the `matRipple´ directive as long as the surrounded elements are properly handled.

@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 10, 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

2 participants