-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Vertical scroll is not working for Android when nesting in a ScrollView
#15
Comments
Hm, this is an interesting case. Usually, it's advised to avoid nested scroll views with same orientation in react native. That's why vertical scroll doesn't work as you mentioned. Can you create demo content for |
Thanks for the quick reply. Attached is the component and some test data that will populate the content. The
|
Hi @fakeheal - thanks again for getting back to me yesterday and apologies for following up so soon. Is this something you've been able to replicate and do you have any suggestions on how to fix it? Hopefully the content I provided is enough to replicate, and I also guess this is something that can be replicated with more minimal content. If there's any more info you need, please let me know. Thanks again for building and supporting this great product! |
Hey, @DanStevensonDev, unfortunately I am quite busy this week and I will not able to spend the time needed to look at your case in depth with the provided two files. If you can spare few more minutes, would it be possible to provide a complete repository I can checkout and replicate the problem? |
Hi @fakeheal, thanks for this. I have forked your repo and created a minimal replication here: https://github.com/DanStevensonDev/react-native-pan-pinch-view/tree/replicate-android-error The two changes I made to your example screen are:
This then prevents the Please let me know if you get chance to look at this. |
@DanStevensonDev, Awesome! 🙌 I was able to run the repository and reproduce the problem in an Android emulator. I will take a look tonight. One last question, are you, also, using an emulator or a real device? What are their specs - android version, model, etc? |
@fakeheal - great, thanks! 🙌 These are the devices I've tested with... The emulator is: Pixel_3a_API_34_extension_level_7_arm64-v8a |
The issue comes from the react-native-gesture-handler. The PanPinchView doesn't implement any ScrollViews, so my initial assumption that nested ScrollViews were causing problems was wrong. After spending several hours trying to figure out a way to make this library work if it's put inside a scroll view for almost all use cases, I came to the conclusion that implementing such "feature" is kind of out of scope of the library right now. :( Here's a great write-up of someone who has faced this issue fairly recently and proposed solutions: Possible workarounds (depending on how flexible your specifications are):
|
@fakeheal - thanks very much for looking into this and for the explanation. Totally understand - scrolls within scrolls can be complicated/weird 😄 We might be able to keep using the package by moving it out of the Thanks again! |
Firstly thanks for making this package - it's been working great for my project requirements! 🙌
I have an issue where the scroll of the
PanPinchView
is disabled on Android in certain conditions:I have a screen component:
For the
Board
component I have:When the content in the screen is less than the screen height (so the scroll for the screen
ScrollView
isn't needed), then thePanPinchView
interactions work fine.When the content is larger than the screen height (so the
ScrollView
scroll is enabled), then thePanPinchView
will not scroll the inner view vertically. Scrolling horizontally seems to work fine.This is also only an issue for Android - on iOS it seems to scroll fine.
I have added
nestedScrollEnabled
(Android-only prop) to the outer screenScrollView
, but this has not had an effect (I guess this is not really relevant for functionality of the package's underlying gesture handler views).Is there a way I can enable the
PanPinchView
scroll to work correctly when nested inside an outerScrollView
?The text was updated successfully, but these errors were encountered: