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 @@ -669,16 +669,17 @@ - (RCTUIView *)betterHitTest:(CGPoint)point withEvent:(UIEvent *)event // [macOS
669
669
}
670
670
671
671
for (RCTUIView *subview in [self .subviews reverseObjectEnumerator ]) { // [macOS]
672
- // Native macOS views require the point to be in the super view coordinate space for hit testing. [macOS]
672
+ #if !TARGET_OS_OSX // [macOS]
673
+ RCTUIView *hitView = [subview hitTest: [subview convertPoint: point fromView: self ] withEvent: event]; // [macOS]
674
+ #else // [macOS
675
+ // Native macOS views require the point to be in the super view coordinate space for hit testing.
673
676
CGPoint hitTestPoint = point;
674
- #if TARGET_OS_OSX // [macOS
675
677
// Fabric components use the target view coordinate space for hit testing
676
678
if ([subview isKindOfClass: [RCTViewComponentView class ]]) {
677
679
hitTestPoint = [subview convertPoint: point fromView: self ];
678
680
}
679
- #endif // macOS]
680
-
681
681
RCTUIView *hitView = [subview hitTest: hitTestPoint withEvent: event]; // [macOS]
682
+ #endif // macOS]
682
683
if (hitView) {
683
684
return hitView;
684
685
}
You can’t perform that action at this time.
0 commit comments