Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,17 @@ - (RCTUIView *)betterHitTest:(CGPoint)point withEvent:(UIEvent *)event // [macOS
}

for (RCTUIView *subview in [self.subviews reverseObjectEnumerator]) { // [macOS]
#if !TARGET_OS_OSX // [macOS]
RCTUIView *hitView = [subview hitTest:[subview convertPoint:point fromView:self] withEvent:event]; // [macOS]
#else // [macOS
// Native macOS views require the point to be in the super view coordinate space for hit testing.
CGPoint hitTestPoint = point;
// Fabric components use the target view coordinate space for hit testing
if ([subview isKindOfClass:[RCTViewComponentView class]]) {
hitTestPoint = [subview convertPoint:point fromView:self];
}
RCTUIView *hitView = [subview hitTest:hitTestPoint withEvent:event]; // [macOS]
#endif // macOS]
if (hitView) {
return hitView;
}
Expand Down
Loading