Skip to content

Commit

Permalink
Make simultaneous handlers always symmetric on iOS (#2800)
Browse files Browse the repository at this point in the history
## Description

Current behavior only checks `simultaneousHandlers` field of the other
handler if there are none set in `simultaneousHandlers` of `this`
handler. This effectively makes it so the field is symmetrical only if
there are no simultaneous handlers declared on `this` handler.

This PR changes it, so that `simultaneousHandlers` of the other handler
are checked always if the checked handler tag is not present in this
handler's simultaneous list. This means that only one handler needs to
declare being simultaneous with the other one instead of declaring it
both ways.
  • Loading branch information
j-piasecki authored Mar 12, 2024
1 parent d0cea67 commit 5f6bbb4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apple/RNGestureHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,9 @@ - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
return YES;
}
}
} else if (handler->_simultaneousHandlers) {
}

if (handler->_simultaneousHandlers) {
for (NSNumber *handlerTag in handler->_simultaneousHandlers) {
if ([self.tag isEqual:handlerTag]) {
return YES;
Expand Down

0 comments on commit 5f6bbb4

Please sign in to comment.