Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/react-native/ReactCommon/yoga/yoga/YGNodeStyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,16 @@ YGOverflow YGNodeStyleGetOverflow(const YGNodeConstRef node) {
}

void YGNodeStyleSetDisplay(const YGNodeRef node, const YGDisplay display) {
const bool wasContents =
resolveRef(node)->style().display() == Display::Contents;
updateStyle<&Style::display, &Style::setDisplay>(node, scopedEnum(display));

// The owner caches how many of its children use display: contents, so it
// has to be recomputed when an attached child switches to or from it.
auto owner = resolveRef(node)->getOwner();
if (owner != nullptr && wasContents != (display == YGDisplayContents)) {
owner->setChildren(owner->getChildren());
}
}

YGDisplay YGNodeStyleGetDisplay(const YGNodeConstRef node) {
Expand Down
Loading