Control thresholds of nested horizontal & vertical scrollviews #2978
Unanswered
SanderRonde
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'd like to have a bunch of vertical scrollviews inside a single horizontal scrollview, with me being able to control the thresholds for when to scroll horizontally and when to scroll vertically. So for example if the ratio
dx:dy
<1:2
, have the horizontal scrollview capture it, otherwise vertical.I did look into using RNGH but couldn't really figure out a way. It looks like the library is aimed at intercepting gestures and handling them yourself but (from what I can gather) it's not possible to then "pass on" that gesture to a
ScrollView
. So for example you can't create aPanGesture
withminPointers(2)
and have that be passed on to a ScrollView, thereby turning it into a ScrollView that only accepts 2-finger swipes.However it does sound like it's maybe possible since it is possible to use
waitFor
to force the ScrollView to wait for another event. But I'm not too sure if this can be used to have the ScrollView conditionally handle an event. One direction to go in could be usingwaitFor
to prevent all non-matching gestures. So in the above 2-pointer example you could have itwaitFor
an even that takes exactly 1 pointer, thereby having the ScrollView take all 2-pointer+ gestures. But in my case I'd want that gesture to then be handled by the other ScrollView, which is where this approach falls apart.Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions