Skip to content

Commit

Permalink
Mark all children as dirty if display changes
Browse files Browse the repository at this point in the history
Summary:
If we set ```display:none``` all children are set with layout sizes/values of 0. We need do mark all those children as dirty to force a relayout if we toggle the display on a higher parent node. This fixes facebook#443
Closes facebook/yoga#448

Reviewed By: astreet

Differential Revision: D4642273

Pulled By: emilsjolander

fbshipit-source-id: dfdb920e2049952bd6c7f48cfa53b1448e1f3e8f
  • Loading branch information
woehrl01 authored and facebook-github-bot committed Mar 3, 2017
1 parent a1406c4 commit 495fb54
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ReactCommon/yoga/yoga/Yoga.c
Original file line number Diff line number Diff line change
Expand Up @@ -1791,6 +1791,12 @@ static void YGZeroOutLayoutRecursivly(const YGNodeRef node) {
node->layout.position[YGEdgeBottom] = 0;
node->layout.position[YGEdgeLeft] = 0;
node->layout.position[YGEdgeRight] = 0;
node->layout.cachedLayout.availableHeight = 0;
node->layout.cachedLayout.availableWidth = 0;
node->layout.cachedLayout.heightMeasureMode = YGMeasureModeExactly;
node->layout.cachedLayout.widthMeasureMode = YGMeasureModeExactly;
node->layout.cachedLayout.computedWidth = 0;
node->layout.cachedLayout.computedHeight = 0;
const uint32_t childCount = YGNodeGetChildCount(node);
for (uint32_t i = 0; i < childCount; i++) {
const YGNodeRef child = YGNodeListGet(node->children, i);
Expand Down

0 comments on commit 495fb54

Please sign in to comment.