From a6868161cbc09e25c3730d7195584645ddc03636 Mon Sep 17 00:00:00 2001 From: Martin Kralik Date: Tue, 23 Aug 2016 03:43:31 -0700 Subject: [PATCH] dont use ios border rendering if we use default black color Summary: iOS and css have a different way to draw borders. Decision which rendering to use considers alpha value of given color as well. If alpha=0 -> border is invisible -> we use ios render. That doesn't work as expected in a case where only `borderWidth` property is set. A default black color is used when no `borderColor` is set, but alpha checking logic will test `null`. Which resolves as alpha=0. Reviewed By: javache Differential Revision: D3750523 fbshipit-source-id: 453d52a16287c6286e8887a9ab3795d3ded1dec6 --- React/Views/RCTView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/React/Views/RCTView.m b/React/Views/RCTView.m index ac8718eed..0aa03e462 100644 --- a/React/Views/RCTView.m +++ b/React/Views/RCTView.m @@ -477,7 +477,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:unused) // the content. For this reason, only use iOS border drawing when clipping // or when the border is hidden. - (borderInsets.top == 0 || CGColorGetAlpha(borderColors.top) == 0 || self.clipsToBounds); + (borderInsets.top == 0 || (borderColors.top && CGColorGetAlpha(borderColors.top) == 0) || self.clipsToBounds); // iOS clips to the outside of the border, but CSS clips to the inside. To // solve this, we'll need to add a container view inside the main view to