Skip to content

Commit 08fbeff

Browse files
fix(ios): stop setting masksToBounds for animated borderRadius
cornerRadius alone rounds the view's background visually. masksToBounds clips children and shadows, which conflicts with shadow animations and doesn't match RN's default overflow:visible. Let the style system control masksToBounds via the overflow prop instead.
1 parent c96ea51 commit 08fbeff

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

ios/EaseView.mm

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,6 @@ - (void)applyFirstMountProps:(const EaseViewProps &)viewProps {
428428
self.layer.transform = [self initialTransformFromProps:viewProps];
429429
if (mask & kMaskBorderRadius) {
430430
self.layer.cornerRadius = viewProps.initialAnimateBorderRadius;
431-
self.layer.masksToBounds = viewProps.initialAnimateBorderRadius > 0 ||
432-
viewProps.animateBorderRadius > 0;
433431
}
434432
if (mask & kMaskBackgroundColor)
435433
self.layer.backgroundColor =
@@ -683,10 +681,8 @@ - (void)applyFirstMountProps:(const EaseViewProps &)viewProps {
683681
self.layer.opacity = viewProps.animateOpacity;
684682
if (hasTransform)
685683
self.layer.transform = [self targetTransformFromProps:viewProps];
686-
if (mask & kMaskBorderRadius) {
684+
if (mask & kMaskBorderRadius)
687685
self.layer.cornerRadius = viewProps.animateBorderRadius;
688-
self.layer.masksToBounds = viewProps.animateBorderRadius > 0;
689-
}
690686
if (mask & kMaskBackgroundColor)
691687
self.layer.backgroundColor =
692688
RCTUIColorFromSharedColor(viewProps.animateBackgroundColor).CGColor;
@@ -780,10 +776,8 @@ - (void)updateProps:(const Props::Shared &)props
780776
self.layer.opacity = newViewProps.animateOpacity;
781777
if (hasTransform)
782778
self.layer.transform = [self targetTransformFromProps:newViewProps];
783-
if (mask & kMaskBorderRadius) {
779+
if (mask & kMaskBorderRadius)
784780
self.layer.cornerRadius = newViewProps.animateBorderRadius;
785-
self.layer.masksToBounds = newViewProps.animateBorderRadius > 0;
786-
}
787781
if (mask & kMaskBackgroundColor)
788782
self.layer.backgroundColor =
789783
RCTUIColorFromSharedColor(newViewProps.animateBackgroundColor)
@@ -978,7 +972,6 @@ - (void)updateProps:(const Props::Shared &)props
978972
EaseTransitionConfig brConfig =
979973
transitionConfigForProperty("borderRadius", newViewProps);
980974
self.layer.cornerRadius = newViewProps.animateBorderRadius;
981-
self.layer.masksToBounds = newViewProps.animateBorderRadius > 0;
982975
if (brConfig.type == "none") {
983976
[self.layer removeAnimationForKey:kAnimKeyCornerRadius];
984977
} else {
@@ -1190,7 +1183,6 @@ - (void)invalidateLayer {
11901183
if (mask & kMaskBorderRadius) {
11911184
[self.layer removeAnimationForKey:@"cornerRadius"];
11921185
self.layer.cornerRadius = viewProps.animateBorderRadius;
1193-
self.layer.masksToBounds = viewProps.animateBorderRadius > 0;
11941186
}
11951187
if (mask & kMaskBackgroundColor) {
11961188
[self.layer removeAnimationForKey:@"backgroundColor"];

0 commit comments

Comments
 (0)