Skip to content

Commit 2814ae2

Browse files
Nick LefeverSaadnajmi
authored andcommitted
[fabric] Disable view flattening for views using mouse events
Summary: Views having mouse event handlers assigned to them should not be flattened so that the mouse tracking for the area they cover would work at all times. This diff disabled view flattening if either of the mouse event handlers is set. Test Plan: Tested later in this stack. Reviewers: shawndempsey, #rn-desktop Reviewed By: shawndempsey Differential Revision: https://phabricator.intern.facebook.com/D53529017 Tasks: T154617556
1 parent d655dd4 commit 2814ae2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/react-native/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewTraitsInitializer.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ inline bool formsStackingContext(const ViewProps& props) {
1717
}
1818

1919
inline bool formsView(const ViewProps& props) {
20-
return props.focusable;
20+
return props.focusable ||
21+
props.macOSViewEvents[MacOSViewEvents::Offset::MouseEnter] ||
22+
props.macOSViewEvents[MacOSViewEvents::Offset::MouseLeave];
2123
}
2224

2325
} // namespace facebook::react::HostPlatformViewTraitsInitializer

0 commit comments

Comments
 (0)