Skip to content

Commit a77671b

Browse files
j-piaseckifacebook-github-bot
authored andcommitted
Fix for nodes with display: contents not being cleaned in some cases
Summary: Fixes a case where a node with `display: contents` would not be cleaned up in some cases. This was caused by it being called after some early returns handling different quick paths. This PR moves the call to `cleanupContentsNodesRecursively` earlier so that it's always called. Changelog: [General][Fixed] - Fix for nodes with `display: contents` not being cleaned in some cases X-link: facebook/yoga#1729 Differential Revision: D64910099 Pulled By: NickGerleman
1 parent 70c7616 commit a77671b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/react-native/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,6 +1316,10 @@ static void calculateLayoutImpl(
13161316
flexColumnDirection, direction, ownerWidth),
13171317
PhysicalEdge::Bottom);
13181318

1319+
// Clean and update all display: contents nodes with a direct path to the
1320+
// current node as they will not be traversed
1321+
cleanupContentsNodesRecursively(node);
1322+
13191323
if (node->hasMeasureFunc()) {
13201324
measureNodeWithMeasureFunc(
13211325
node,
@@ -1366,9 +1370,6 @@ static void calculateLayoutImpl(
13661370
// Reset layout flags, as they could have changed.
13671371
node->setLayoutHadOverflow(false);
13681372

1369-
// Clean and update all display: contents nodes with a direct path to the
1370-
// current node as they will not be traversed
1371-
cleanupContentsNodesRecursively(node);
13721373
// STEP 1: CALCULATE VALUES FOR REMAINDER OF ALGORITHM
13731374
const FlexDirection mainAxis =
13741375
resolveDirection(node->style().flexDirection(), direction);

0 commit comments

Comments
 (0)