Skip to content

Commit e03a770

Browse files
authored
fix(material/core): ripples not being clipped on safari in shadow dom (#24029)
1 parent b3c9579 commit e03a770

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/material/core/ripple/_ripple.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@
3030
pointer-events: none;
3131

3232
transition: opacity, transform 0ms cubic-bezier(0, 0, 0.2, 1);
33-
transform: scale(0);
33+
34+
// We use a 3d transform here in order to avoid an issue in Safari where
35+
// the ripples aren't clipped when inside the shadow DOM (see #24028).
36+
transform: scale3d(0, 0, 0);
3437

3538
// In high contrast mode the ripple is opaque, causing it to obstruct the content.
3639
@include a11y.high-contrast(active, off) {

src/material/core/ripple/ripple-renderer.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ export class RippleRenderer implements EventListenerObject {
138138
// ripple elements. This is critical because then the `scale` would not animate properly.
139139
enforceStyleRecalculation(ripple);
140140

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

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

0 commit comments

Comments
 (0)