Skip to content

Commit

Permalink
[skip ci] Make it so that a view with a filter forms a stacking conte…
Browse files Browse the repository at this point in the history
  • Loading branch information
joevilches authored and facebook-github-bot committed May 7, 2024
1 parent 3d75a57 commit 4047017
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ void ViewShadowNode::initialize() noexcept {
viewProps.accessibilityViewIsModal ||
viewProps.importantForAccessibility != ImportantForAccessibility::Auto ||
viewProps.removeClippedSubviews || viewProps.cursor != Cursor::Auto ||
!viewProps.filter.empty() ||
HostPlatformViewTraitsInitializer::formsStackingContext(viewProps);

bool formsView = formsStackingContext ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,11 @@ void YogaLayoutableShadowNode::updateYogaProps() {
yogaNode_.setStyle(styleResult);
if (getTraits().check(ShadowNodeTraits::ViewKind)) {
auto& viewProps = static_cast<const ViewProps&>(*props_);
YGNodeSetAlwaysFormsContainingBlock(
&yogaNode_, viewProps.transform != Transform::Identity());
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
bool alwaysFormsContainingBlock =
viewProps.transform != Transform::Identity() ||
!viewProps.filter.empty();
YGNodeSetAlwaysFormsContainingBlock(&yogaNode_, alwaysFormsContainingBlock);
}
}

Expand Down

0 comments on commit 4047017

Please sign in to comment.