diff --git a/packages/react-native-gesture-handler/apple/Handlers/RNFlingHandler.m b/packages/react-native-gesture-handler/apple/Handlers/RNFlingHandler.m index 554aba88e4..79cf28511c 100644 --- a/packages/react-native-gesture-handler/apple/Handlers/RNFlingHandler.m +++ b/packages/react-native-gesture-handler/apple/Handlers/RNFlingHandler.m @@ -53,6 +53,8 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event _lastPoint = [[[touches allObjects] objectAtIndex:0] locationInView:_gestureHandler.recognizer.view]; [super touchesEnded:touches withEvent:event]; [_gestureHandler.pointerTracker touchesEnded:touches withEvent:event]; + + [self triggerAction]; } - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event @@ -60,6 +62,8 @@ - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)ev _lastPoint = [[[touches allObjects] objectAtIndex:0] locationInView:_gestureHandler.recognizer.view]; [super touchesCancelled:touches withEvent:event]; [_gestureHandler.pointerTracker touchesCancelled:touches withEvent:event]; + + [self triggerAction]; } - (void)triggerAction @@ -69,7 +73,6 @@ - (void)triggerAction - (void)reset { - [self triggerAction]; [_gestureHandler.pointerTracker reset]; _hasBegan = NO; [super reset]; diff --git a/packages/react-native-gesture-handler/apple/Handlers/RNLongPressHandler.m b/packages/react-native-gesture-handler/apple/Handlers/RNLongPressHandler.m index 23b2613089..f4b1e5cfed 100644 --- a/packages/react-native-gesture-handler/apple/Handlers/RNLongPressHandler.m +++ b/packages/react-native-gesture-handler/apple/Handlers/RNLongPressHandler.m @@ -102,12 +102,16 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { [super touchesEnded:touches withEvent:event]; [_gestureHandler.pointerTracker touchesEnded:touches withEvent:event]; + + [self triggerAction]; } - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { [super touchesCancelled:touches withEvent:event]; [_gestureHandler.pointerTracker touchesCancelled:touches withEvent:event]; + + [self triggerAction]; } #else @@ -181,10 +185,6 @@ - (BOOL)shouldCancelGesture - (void)reset { - if (self.state == UIGestureRecognizerStateFailed) { - [self triggerAction]; - } - [_gestureHandler.pointerTracker reset]; [super reset]; diff --git a/packages/react-native-gesture-handler/apple/Handlers/RNPanHandler.m b/packages/react-native-gesture-handler/apple/Handlers/RNPanHandler.m index 8b8c4bdc1b..594921b72d 100644 --- a/packages/react-native-gesture-handler/apple/Handlers/RNPanHandler.m +++ b/packages/react-native-gesture-handler/apple/Handlers/RNPanHandler.m @@ -165,6 +165,8 @@ - (void)interactionsMoved:(NSSet *)touches withEvent:(UIEvent *)event // UIGestureRecognizerStateFailed here. Making the behavior explicit. self.state = (self.state == UIGestureRecognizerStatePossible) ? UIGestureRecognizerStateFailed : UIGestureRecognizerStateCancelled; + + [self triggerAction]; [self reset]; return; } @@ -243,19 +245,22 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { [super touchesEnded:touches withEvent:event]; [self interactionsEnded:touches withEvent:event]; + + [self triggerAction]; } - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { [super touchesCancelled:touches withEvent:event]; [self interactionsCancelled:touches withEvent:event]; + + [self triggerAction]; } #endif - (void)reset { - [self triggerAction]; [_gestureHandler.pointerTracker reset]; [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(activateAfterLongPress) object:nil]; self.enabled = YES; diff --git a/packages/react-native-gesture-handler/apple/Handlers/RNTapHandler.m b/packages/react-native-gesture-handler/apple/Handlers/RNTapHandler.m index d10c05a5ef..da0b14aa2c 100644 --- a/packages/react-native-gesture-handler/apple/Handlers/RNTapHandler.m +++ b/packages/react-native-gesture-handler/apple/Handlers/RNTapHandler.m @@ -131,6 +131,8 @@ - (void)interactionsEnded:(NSSet *)touches withEvent:(UIEvent *)event if (_numberOfTaps == _tapsSoFar && _maxNumberOfTouches >= _minPointers) { self.state = UIGestureRecognizerStateEnded; + + [self triggerAction]; [self reset]; } else { [self performSelector:@selector(cancel) withObject:nil afterDelay:_maxDelay]; @@ -141,6 +143,8 @@ - (void)interactionsCancelled:(NSSet *)touches withEvent:(UIEvent *)event { [_gestureHandler.pointerTracker touchesCancelled:touches withEvent:event]; self.state = UIGestureRecognizerStateCancelled; + + [self triggerAction]; [self reset]; } @@ -200,12 +204,16 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { [super touchesEnded:touches withEvent:event]; [self interactionsEnded:touches withEvent:event]; + + [self triggerAction]; } - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { [super touchesCancelled:touches withEvent:event]; [self interactionsCancelled:touches withEvent:event]; + + [self triggerAction]; } #endif @@ -243,9 +251,6 @@ - (BOOL)shouldFailUnderCustomCriteria - (void)reset { - if (self.state == UIGestureRecognizerStateFailed) { - [self triggerAction]; - } [_gestureHandler.pointerTracker reset]; [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(cancel) object:nil];