From af5ecb2916be4519075f34c0db551988ad3eca09 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Tue, 25 Feb 2020 07:02:34 -0800 Subject: [PATCH] Fix layer.mask not being reset after recycle Summary: Changelog: [Internal] If `layer.mask` was set and the view got reused without having a different `layer.mask`, this value would persist between reuses. I also added a call to `super finalizeUpdates` as it is best practice to call super, the parent class right now doesn't do anything but in the future we might add there some default logic. Reviewed By: shergin Differential Revision: D20030174 fbshipit-source-id: c90be3f4e9a8f3814000f177a3d50061f5aa120c --- .../Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm index c0d5eec27e1..39dc08e2fca 100644 --- a/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm @@ -267,6 +267,7 @@ using namespace facebook::react; - (void)finalizeUpdates:(RNComponentViewUpdateMask)updateMask { + [super finalizeUpdates:updateMask]; if (!_needsInvalidateLayer) { return; } @@ -399,6 +400,7 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle) colorComponentsFromColor(borderMetrics.borderColors.left).alpha == 0 || self.clipsToBounds); if (useCoreAnimationBorderRendering) { + layer.mask = nil; if (_borderLayer) { [_borderLayer removeFromSuperlayer]; _borderLayer = nil;