Open kballenegger opened 7 years ago
+1
So as far as I can tell in React Native a child component cannot stop propagation to a parent. This component has a hasTouch event handler that is fired if the parent passed in a function. What I did is disabled the Scrollable property of the scroll view when hasTouch indicates true and re-enabled when hasTouch indicates false. I had to fix a bug with componentWillReceiveProps inside of the viewpager component as it would reset the page back to 0 when i changed the scrollable property of the parent.
The logic that the PanResponder uses in order to determine when to capture moves is not ideal. Put the pager within a ListView or vertical ScrollView and it becomes instantly obvious, because a minimal amount of up-or-down movement will cancel the pager drag, animate to the closest page, and scroll the view up and down.