Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset relevant handler when recognizer gets reset. #2705

Merged
merged 2 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apple/Handlers/RNFlingHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ - (void)reset
[_gestureHandler.pointerTracker reset];
_hasBegan = NO;
[super reset];
[_gestureHandler reset];
}

- (CGPoint)getLastLocation
Expand Down
1 change: 1 addition & 0 deletions apple/Handlers/RNForceTouchHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ - (void)reset
{
[_gestureHandler.pointerTracker reset];
[super reset];
[_gestureHandler reset];
_force = 0;
_firstTouch = NULL;
}
Expand Down
6 changes: 6 additions & 0 deletions apple/Handlers/RNHoverHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ - (void)cancel
self.enabled = NO;
}

- (void)reset
{
[super reset];
[_gestureHandler reset];
}

- (UIPointerStyle *)pointerInteraction:(UIPointerInteraction *)interaction styleForRegion:(UIPointerRegion *)region
{
if (interaction.view != nil && _hoverEffect != RNGestureHandlerHoverEffectNone) {
Expand Down
1 change: 1 addition & 0 deletions apple/Handlers/RNLongPressHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ - (void)reset
[_gestureHandler.pointerTracker reset];

[super reset];
[_gestureHandler reset];
}

- (NSUInteger)getDuration
Expand Down
1 change: 1 addition & 0 deletions apple/Handlers/RNManualHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ - (void)reset
{
[_gestureHandler.pointerTracker reset];
[super reset];
[_gestureHandler reset];

_shouldSendBeginEvent = YES;
}
Expand Down
1 change: 1 addition & 0 deletions apple/Handlers/RNNativeViewHandler.mm
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ - (void)reset
{
[_gestureHandler.pointerTracker reset];
[super reset];
[_gestureHandler reset];
}

@end
Expand Down
2 changes: 2 additions & 0 deletions apple/Handlers/RNPanHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ - (void)interactionsMoved:(NSSet *)touches withEvent:(UIEvent *)event

if (self.state == UIGestureRecognizerStatePossible && [self shouldFailUnderCustomCriteria]) {
self.state = UIGestureRecognizerStateFailed;
[self triggerAction];
m-bert marked this conversation as resolved.
Show resolved Hide resolved
return;
}

Expand Down Expand Up @@ -218,6 +219,7 @@ - (void)reset
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(activateAfterLongPress) object:nil];
self.enabled = YES;
[super reset];
[_gestureHandler reset];
}

- (void)updateHasCustomActivationCriteria
Expand Down
1 change: 1 addition & 0 deletions apple/Handlers/RNPinchHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ - (void)reset
{
[_gestureHandler.pointerTracker reset];
[super reset];
[_gestureHandler reset];
}

@end
Expand Down
1 change: 1 addition & 0 deletions apple/Handlers/RNRotationHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ - (void)reset
{
[_gestureHandler.pointerTracker reset];
[super reset];
[_gestureHandler reset];
}

@end
Expand Down
1 change: 1 addition & 0 deletions apple/Handlers/RNTapHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ - (void)reset
_maxNumberOfTouches = 0;
self.enabled = YES;
[super reset];
[_gestureHandler reset];
}

@end
Expand Down
Loading