File tree 1 file changed +5
-4
lines changed
packages/react-native/React/Fabric/Mounting/ComponentViews/View
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -660,16 +660,17 @@ - (RCTUIView *)betterHitTest:(CGPoint)point withEvent:(UIEvent *)event // [macOS
660
660
}
661
661
662
662
for (RCTUIView *subview in [self .subviews reverseObjectEnumerator ]) { // [macOS]
663
- // Native macOS views require the point to be in the super view coordinate space for hit testing. [macOS]
663
+ #if !TARGET_OS_OSX // [macOS]
664
+ RCTUIView *hitView = [subview hitTest: [subview convertPoint: point fromView: self ] withEvent: event]; // [macOS]
665
+ #else // [macOS
666
+ // Native macOS views require the point to be in the super view coordinate space for hit testing.
664
667
CGPoint hitTestPoint = point;
665
- #if TARGET_OS_OSX // [macOS
666
668
// Fabric components use the target view coordinate space for hit testing
667
669
if ([subview isKindOfClass: [RCTViewComponentView class ]]) {
668
670
hitTestPoint = [subview convertPoint: point fromView: self ];
669
671
}
670
- #endif // macOS]
671
-
672
672
RCTUIView *hitView = [subview hitTest: hitTestPoint withEvent: event]; // [macOS]
673
+ #endif // macOS]
673
674
if (hitView) {
674
675
return hitView;
675
676
}
You can’t perform that action at this time.
0 commit comments