-
Notifications
You must be signed in to change notification settings - Fork 420
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
fix(ios): parent scroll view not able to scroll #734
fix(ios): parent scroll view not able to scroll #734
Conversation
Hi, @intergalacticspacehighway. Thank you for your PR! Now, in our project, we still have several issues with that fix
|
@@ -408,7 +408,7 @@ + (ComponentDescriptorProvider)componentDescriptorProvider | |||
|
|||
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { | |||
|
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 (!self.scrollEnabled) { | |
return YES; | |
} |
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.
I guess, we should always recognize simultaneously in that case
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.
simultaneous by default returns false. So I wanted to preserve the original behaviour and allow recognize only when it's RN screen's triggered pop gesture. But i think your suggestion might also make sense e.g. current gesture is blocked so allow the other 🤔. Does this change fixes your issues?
Hey 👋 |
Would be great to have it fixed though |
Summary
Fixes - #722
The default iOS's ScrollView allows nested ScrollView. i.e. a child scroll view doesn't prevent scrolling of the parent scroll view. It's done internally but I couldn't find any documentation on how it's being done, the delegates used by ScrollView doesn't seem to be public. Since we're overriding shouldRecognizeSimultaneouslyWithGestureRecognizer and returning NO, the parent scroll view is not able to scroll anymore. I set it to NO because that is the default behaviour in most cases but looks like to support Parent scroll views we need to return YES when the other recognizer is a ScrollView. This surely needs some more testing though.
Test Plan
In the below code snippet, the parent scroll view should be able to scroll.
What's required for testing (prerequisites)?
What are the steps to reproduce (after prerequisites)?
Compatibility
Checklist
README.md