From ab5e2e8099870a313ab2d24344f336604273f573 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Thu, 15 Feb 2024 07:54:46 -0800 Subject: [PATCH] Fix forwarding touches to components in the Interop Layer Summary: When analyzing the `hitTest:withEvent` function, I realized that we were not forwarding the touches to the legacy view. The previous algorithm was returning the InteropLegacyWrapper view itself when the touches were happening in the legacy view, preventing the handlers attached to the legacy view to fire. With this change, if the legacy view receives a touch, it can handle it. ## Changelog [iOS][Fixed] - Make sure to forward touches to the wrapped component in the InteropLayer. Reviewed By: sammy-SC Differential Revision: D53806218 fbshipit-source-id: 87b0aa6e900935092e6f5e1533b871c1d224b718 --- .../RCTLegacyViewManagerInteropComponentView.mm | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm index 98bcfa8bc48b36..d3f4abfb771511 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm @@ -41,17 +41,6 @@ - (instancetype)initWithFrame:(CGRect)frame return self; } -- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event -{ - UIView *result = [super hitTest:point withEvent:event]; - - if (result == _adapter.paperView) { - return self; - } - - return result; -} - - (RCTLegacyViewManagerInteropCoordinator *)_coordinator { if (_state != nullptr) {