Skip to content

fix(material/core): ripples not being clipped on safari in shadow dom #24029

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

Merged
merged 1 commit into from
Jan 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/material/core/ripple/_ripple.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
pointer-events: none;

transition: opacity, transform 0ms cubic-bezier(0, 0, 0.2, 1);
transform: scale(0);

// We use a 3d transform here in order to avoid an issue in Safari where
// the ripples aren't clipped when inside the shadow DOM (see #24028).
transform: scale3d(0, 0, 0);

// In high contrast mode the ripple is opaque, causing it to obstruct the content.
@include a11y.high-contrast(active, off) {
Expand Down
4 changes: 3 additions & 1 deletion src/material/core/ripple/ripple-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ export class RippleRenderer implements EventListenerObject {
// ripple elements. This is critical because then the `scale` would not animate properly.
enforceStyleRecalculation(ripple);

ripple.style.transform = 'scale(1)';
// We use a 3d transform here in order to avoid an issue in Safari where
// the ripples aren't clipped when inside the shadow DOM (see #24028).
ripple.style.transform = 'scale3d(1, 1, 1)';

// Exposed reference to the ripple that will be returned.
const rippleRef = new RippleRef(this, ripple, config);
Expand Down