Fix touch handling in bridged paper components

Summary:
Changelog: [internal]

If view was bridged from Paper, hit testing would return Paper view which doesn't have reference to Fabric's event emitter.
To fix this, if the bridged view is returned from hit testing, it is swapped with interop view which has reference to event emitter.

Reviewed By: shergin

Differential Revision: D23840054

fbshipit-source-id: d4aa4ee8da4e1da80d2e2b69b79ed82d726f04e3
This commit is contained in:
Samuel Susla
2020-09-24 01:07:23 -07:00
committed by Facebook GitHub Bot
parent 64ac01dbbe
commit c907202d2b
@@ -37,6 +37,17 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
return self;
}
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
UIView *result = [super hitTest:point withEvent:event];
if (result == _adapter.paperView) {
return self;
}
return result;
}
+ (NSMutableSet<NSString *> *)supportedViewManagers
{
static NSMutableSet<NSString *> *supported = [NSMutableSet setWithObjects:@"Picker",