Cancel touches if surface touch handler can be prevented

Summary:
Changelog: [internal]

If `otherGestureRecognizer` prevents Fabric's gesture recogniser, we need to manually reset the inner state.
This cancels any currently active touches.

Reviewed By: shergin

Differential Revision: D25664384

fbshipit-source-id: 9e3cd41351381bcfed2836dad3e80d5f021f936c
This commit is contained in:
Samuel Susla
2020-12-21 14:00:50 -08:00
committed by Facebook GitHub Bot
parent e3d8a6b222
commit a3918f4102
+10
View File
@@ -410,4 +410,14 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithTarget : (id)target action : (SEL)act
return [self canBePreventedByGestureRecognizer:otherGestureRecognizer];
}
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
BOOL canBePrevented = [self canBePreventedByGestureRecognizer:otherGestureRecognizer];
if (canBePrevented) {
[self reset];
}
return NO;
}
@end