Skip to content

Commit b0b70c4

Browse files
authored
Make manual activation recognizer not cancel UIControls (#2545)
## Description On iOS, manual activation is implemented in a somewhat hacky way: - if a gesture is declared with manual activation, an additional MA recognizer is added to a view - that recognizer activated immediately, and the original recognizer requires it to fail in order to activate - when we want to activate to original recognizer we simply cancel the MA recognizer That's because there's no API for delaying or forcing recognizer activation on iOS, but making require-to-fail relations and failing recognizers is pretty straightforward. The issue with that approach was the fact, that activation of the MA recognizer caused all touches in the view to be canceled, which meant that every UIControl wouldn't work. This PR adds `cancelsTouchesInView = NO` to the MA recognizer, to prevent it from canceling underlying `UIControls`. Fixes #2544 ## Test plan Tested on the Example app and on the code from the issue.
1 parent 4de626c commit b0b70c4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ios/RNManualActivationRecognizer.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ - (id)initWithGestureHandler:(RNGestureHandler *)gestureHandler
1010
{
1111
if ((self = [super initWithTarget:self action:@selector(handleGesture:)])) {
1212
_handler = gestureHandler;
13-
self.delegate = self;
1413
_activePointers = 0;
14+
self.delegate = self;
15+
self.cancelsTouchesInView = NO;
1516
}
1617
return self;
1718
}

0 commit comments

Comments
 (0)