Skip to content

Commit b15f8a3

Browse files
rozelefacebook-github-bot
authored andcommitted
Fixes layout of nodes with YGDisplayNone and YGPositionTypeAbsolute (#1068)
Summary: Pull Request resolved: facebook/yoga#1068 There is an issue in react-native when the Yoga node position type is set to absolute and display: none is set where the node layout calculation gives the absolute dimensions, rather than the expected 0 x 0. Here are some OSS issues tracking this: #18415 microsoft/react-native-windows#7289 ## Changelog [General] [Fix] - Fixes layout of nodes with YGDisplayNone and YGPositionTypeAbsolute Reviewed By: Andrey-Mishanin Differential Revision: D26849307 fbshipit-source-id: 197618aa3c4e1b3b7efeba7ea4efd30b2d1c982d
1 parent 81c895f commit b15f8a3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ReactCommon/yoga/yoga/Yoga.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -3557,7 +3557,8 @@ static void YGNodelayoutImpl(
35573557
if (performLayout) {
35583558
// STEP 10: SIZING AND POSITIONING ABSOLUTE CHILDREN
35593559
for (auto child : node->getChildren()) {
3560-
if (child->getStyle().positionType() != YGPositionTypeAbsolute) {
3560+
if (child->getStyle().display() == YGDisplayNone ||
3561+
child->getStyle().positionType() != YGPositionTypeAbsolute) {
35613562
continue;
35623563
}
35633564
YGNodeAbsoluteLayoutChild(

0 commit comments

Comments
 (0)