Skip to content

Commit 700d320

Browse files
kruczymeta-codesync[bot]
authored andcommitted
fix hit test for components using legacy module interop (#54802)
Summary: This fixes hit tests in view using legacy module interop since the interop adds another view surrounding the actual view it needs to delegate the hit test to the actual component it wraps ## Changelog: [IOS] [FIXED] - Fix legacy module interop not handling hitTest correctly Pull Request resolved: #54802 Reviewed By: cortinico Differential Revision: D88630976 Pulled By: cipolleschi fbshipit-source-id: 85ce2b4e4244b05c19942208fdfb6a65d91e2f38
1 parent dd1f83e commit 700d320

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

packages/react-native/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,4 +287,15 @@ - (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args
287287
[_adapter handleCommand:(NSString *)commandName args:(NSArray *)args];
288288
}
289289

290+
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
291+
{
292+
UIView *result = [super hitTest:point withEvent:event];
293+
294+
if (result == self) {
295+
return nil;
296+
}
297+
298+
return result;
299+
}
300+
290301
@end

0 commit comments

Comments
 (0)