Skip to content

Commit a06e4b7

Browse files
MengjueWFacebook Github Bot 4
authored andcommitted
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
1 parent 6651486 commit a06e4b7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

React/CSSLayout/CSSLayout.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -700,9 +700,8 @@ static void setTrailingPosition(CSSNode* node, CSSNode* child, CSSFlexDirection
700700
// If both left and right are defined, then use left. Otherwise return
701701
// +left or -right depending on which is defined.
702702
static float getRelativePosition(CSSNode* node, CSSFlexDirection axis) {
703-
float lead = getLeadingPosition(node, axis);
704-
if (!isUndefined(lead)) {
705-
return lead;
703+
if (isLeadingPosDefined(node, axis)) {
704+
return getLeadingPosition(node, axis);
706705
}
707706
return -getTrailingPosition(node, axis);
708707
}

0 commit comments

Comments
 (0)