diff --git a/Libraries/Text/Text/RCTTextShadowView.m b/Libraries/Text/Text/RCTTextShadowView.m index 7a1af566beb901..d1baf9ccb152ec 100644 --- a/Libraries/Text/Text/RCTTextShadowView.m +++ b/Libraries/Text/Text/RCTTextShadowView.m @@ -305,7 +305,9 @@ - (void)layoutSubviewsWithContext:(RCTLayoutContext)layoutContext RCTLayoutMetrics localLayoutMetrics = shadowView.layoutMetrics; localLayoutMetrics.frame.origin = frame.origin; // Reinforcing a proper frame origin for the Shadow View. - localLayoutMetrics.isHiddenDueToClipping = viewIsTruncated; + if (viewIsTruncated) { + localLayoutMetrics.displayType = RCTDisplayTypeNone; + } [shadowView layoutWithMetrics:localLayoutMetrics layoutContext:localLayoutContext]; } ]; diff --git a/React/Modules/RCTUIManager.m b/React/Modules/RCTUIManager.m index d07ae359e95b72..a8960f88de2e52 100644 --- a/React/Modules/RCTUIManager.m +++ b/React/Modules/RCTUIManager.m @@ -488,7 +488,7 @@ - (RCTViewManagerUIBlock)uiBlockWithLayoutUpdateForRootView:(RCTRootShadowView * UIUserInterfaceLayoutDirection layoutDirection; BOOL isNew; BOOL parentIsNew; - BOOL isHiddenDueToClipping; + RCTDisplayType displayType; } RCTFrameData; // Construct arrays then hand off to main thread @@ -506,7 +506,7 @@ - (RCTViewManagerUIBlock)uiBlockWithLayoutUpdateForRootView:(RCTRootShadowView * layoutMetrics.layoutDirection, shadowView.isNewView, shadowView.superview.isNewView, - layoutMetrics.isHiddenDueToClipping + layoutMetrics.displayType }; } } @@ -568,7 +568,7 @@ - (RCTViewManagerUIBlock)uiBlockWithLayoutUpdateForRootView:(RCTRootShadowView * RCTLayoutAnimation *updatingLayoutAnimation = isNew ? nil : layoutAnimationGroup.updatingLayoutAnimation; BOOL shouldAnimateCreation = isNew && !frameData.parentIsNew; RCTLayoutAnimation *creatingLayoutAnimation = shouldAnimateCreation ? layoutAnimationGroup.creatingLayoutAnimation : nil; - BOOL isHiddenDueToClipping = frameData.isHiddenDueToClipping; + BOOL isHidden = frameData.displayType == RCTDisplayTypeNone; void (^completion)(BOOL) = ^(BOOL finished) { completionsCalled++; @@ -585,8 +585,8 @@ - (RCTViewManagerUIBlock)uiBlockWithLayoutUpdateForRootView:(RCTRootShadowView * view.reactLayoutDirection = layoutDirection; } - if (view.isHidden != isHiddenDueToClipping) { - view.hidden = isHiddenDueToClipping; + if (view.isHidden != isHidden) { + view.hidden = isHidden; } if (creatingLayoutAnimation) { diff --git a/React/Views/RCTLayout.h b/React/Views/RCTLayout.h index e232abc3a26823..57047b39d43edd 100644 --- a/React/Views/RCTLayout.h +++ b/React/Views/RCTLayout.h @@ -26,7 +26,6 @@ struct RCTLayoutMetrics { UIEdgeInsets borderWidth; RCTDisplayType displayType; UIUserInterfaceLayoutDirection layoutDirection; - BOOL isHiddenDueToClipping; }; typedef struct CG_BOXABLE RCTLayoutMetrics RCTLayoutMetrics; @@ -44,8 +43,7 @@ static inline BOOL RCTLayoutMetricsEqualToLayoutMetrics(RCTLayoutMetrics a, RCTL CGRectEqualToRect(a.contentFrame, b.contentFrame) && UIEdgeInsetsEqualToEdgeInsets(a.borderWidth, b.borderWidth) && a.displayType == b.displayType && - a.layoutDirection == b.layoutDirection && - a.isHiddenDueToClipping == b.isHiddenDueToClipping; + a.layoutDirection == b.layoutDirection; } RCT_EXTERN RCTLayoutMetrics RCTLayoutMetricsFromYogaNode(YGNodeRef yogaNode);