From a06e4b75e4e35fe2fddcd6582c863112e8ed6fa3 Mon Sep 17 00:00:00 2001 From: Mengjue Wang Date: Thu, 28 Jul 2016 23:36:20 -0700 Subject: [PATCH] bottom styling isn't applied when a View is not absolute-positioned Summary: The new CSSLayout have a wrong calculate for the getRelativePosition. So use the getLeadingPosition will get 0 instead of return undefined. Fix it with using isLeadingPosDefined. Reviewed By: fkgozali Differential Revision: D3640799 fbshipit-source-id: 50d3bd2ea4c0d8bf96ba34297425ba269b0535cd --- React/CSSLayout/CSSLayout.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/React/CSSLayout/CSSLayout.c b/React/CSSLayout/CSSLayout.c index 19962383b..37ad5c7e3 100644 --- a/React/CSSLayout/CSSLayout.c +++ b/React/CSSLayout/CSSLayout.c @@ -700,9 +700,8 @@ static void setTrailingPosition(CSSNode* node, CSSNode* child, CSSFlexDirection // If both left and right are defined, then use left. Otherwise return // +left or -right depending on which is defined. static float getRelativePosition(CSSNode* node, CSSFlexDirection axis) { - float lead = getLeadingPosition(node, axis); - if (!isUndefined(lead)) { - return lead; + if (isLeadingPosDefined(node, axis)) { + return getLeadingPosition(node, axis); } return -getTrailingPosition(node, axis); }