-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Scope drawer drag workaround to feed pagers #1694
Conversation
@@ -30,13 +30,13 @@ index ab0fc7f..fbbf19f 100644 | |||
if (self.reactViewController.navigationController != nil && self.reactViewController.navigationController.interactivePopGestureRecognizer != nil) { | |||
[self.scrollView.panGestureRecognizer requireGestureRecognizerToFail:self.reactViewController.navigationController.interactivePopGestureRecognizer]; | |||
} | |||
@@ -463,4 +467,21 @@ | |||
@@ -463,4 +467,21 @@ - (NSString *)determineScrollDirection:(UIScrollView *)scrollView { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idk why my git decided to add these but ok
- (BOOL)isLtrLayout { | ||
return [_layoutDirection isEqualToString:@"ltr"]; | ||
} | ||
+ | ||
+- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { | ||
+ if (otherGestureRecognizer == self.scrollView.panGestureRecognizer) { | ||
+ if (!_overdrag && otherGestureRecognizer == self.scrollView.panGestureRecognizer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!_overdrag &&
is the actual change here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay seems to work!
@gaearon would you mind adding this fix into https://github.com/callstack/react-native-pager-view? |
This isn't really a fix tbh, more of a hack for our case. I'm not sure what a proper fix would be since it depends on how your drawer works. |
We have a patch that makes the drawer gesture coexist with feed pagers. However, this patch breaks the overdrag in iOS lightbox. We want to enable this patch only for feed pagers. We could've introduced a prop for this, but conceptually, we really just want to disable the hack when overdrag is on (because it breaks overdrag, and feed pagers don't use overdrag).
By default it's
false
. We only turn it on for the lightbox right now. So this fixes the lightbox.This does that.
Test plan
You'd need to
yarn prebuild
to get the new behavior.