Skip to content

Commit 0649717

Browse files
fabriziocuccimeta-codesync[bot]
authored andcommitted
Prevent view collapsing when pointerEvents is 'box-only' (#55185)
Summary: Pull Request resolved: #55185 Changelog: [Internal] This change ensures that views with `pointerEvents` set to `'box-only'` are not collapsed, preserving the parent-children relationship in the view hierarchy. This is necessary because when `important_for_interaction` is applied on a view with `pointerEvents='box-only'`, the view must remain in the hierarchy to correctly signal to the gaze system that its children are not important for interaction. Without this fix, the view could be collapsed during flattening, breaking the propagation of the `important_for_interaction` property to descendant views. Reviewed By: javache Differential Revision: D90772188 fbshipit-source-id: 6a6a408845ebd1f86e420f5309160e7a6b3a9715
1 parent 03b1bf6 commit 0649717

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/react-native/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ void ViewShadowNode::initialize() noexcept {
4848
};
4949

5050
bool formsStackingContext = !viewProps.collapsable ||
51+
viewProps.pointerEvents == PointerEventsMode::BoxOnly ||
5152
viewProps.pointerEvents == PointerEventsMode::None ||
5253
!viewProps.nativeId.empty() || viewProps.accessible ||
5354
viewProps.opacity != 1.0 || viewProps.transform != Transform{} ||

0 commit comments

Comments
 (0)