Skip to content

Commit

Permalink
Set minHeight instead of minWidth for calculating the layout in RCTSu…
Browse files Browse the repository at this point in the history
…rfaceRootShadowView

Summary:
Fix calculating layout in `RCTSurfaceRootShadowView` as the `minWidth` is set doubled in `calculateLayoutWithMinimumSize:maximumSize:`.

cc shergin
Closes #17203

Differential Revision: D6642437

Pulled By: shergin

fbshipit-source-id: 3483c952c9ecf0132182a156b7b916eb1e975424
  • Loading branch information
maicki authored and facebook-github-bot committed Dec 28, 2017
1 parent 4d33080 commit d3b41e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion React/Base/Surface/RCTSurfaceRootShadowView.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ - (void)calculateLayoutWithMinimumSize:(CGSize)minimumSize maximumSize:(CGSize)m
float availableHeight = isinf(maximimSize.height) ? YGUndefined : maximimSize.height;

self.minWidth = (YGValue){isinf(minimumSize.width) ? YGUndefined : minimumSize.width, YGUnitPoint};
self.minWidth = (YGValue){isinf(minimumSize.height) ? YGUndefined : minimumSize.height, YGUnitPoint};
self.minHeight = (YGValue){isinf(minimumSize.height) ? YGUndefined : minimumSize.height, YGUnitPoint};

YGNodeCalculateLayout(self.yogaNode, availableWidth, availableHeight, _baseDirection);
}
Expand Down

0 comments on commit d3b41e0

Please sign in to comment.