I have a ScrollView inside an animated View that has panning.
<Animated.View {...this.panResponder.panHandlers}>
<ScrollView>
...
</ScrollView>
<Animated.View>
This is a sample view of my screen:
A user should be able to swipe upwards and the draggable area should snap upwards, as shown below:
Now my problem is the Scrollview. I want a user to be able to scroll the content inside.
After the user has finished viewing the content inside and scrolls all the way up(by performing downward swiping motion) and tries to swipe further, the draggable area should move downwards to its original position.
I have tried various methods, mainly focusing on disabling and enabling the scrolling of the ScrollView, to prevent its interference with the panning.
My current solution is not ideal.
My main issue is these 2 methods:
onStartShouldSetPanResponder
onStartShouldSetPanResponderCapture
Not sure if my assumption is correct but these methods decide if the View should capture the touch event. I either allow panning or let the ScrollView capture the event instead.
My problem is I need to somehow know what the user intends to do before the other pan handlers kick in. But I cant know that until the user has moved, either downwards or upwards. To know the direction I need the event to pass on to the onPanResponderMove handler.
So in essence, I need to decide if I should allow my view to be dragged before even knowing the direction the user is swiping. Currently that is not possible.
Hopefully Im missing something simple here.
EDIT: Found a similar question(with no answer): Drag up a ScrollView then continue scroll in React Native