react-native-pager-view
react-native-pager-view copied to clipboard
How to disable ViewPager at ends so that screen gesture can take over?
I'm using react-navigation with the fullScreenSwipeEnabled option which allows to swipe back on the entire screen in iOS.
It's great except on the ViewPager, even when it's at the end it steals the touch and won't let the full-screen back to work.
Is there anyway to disable the viewpager at the ends where it has no more pages so that that the screen-back takes over?
It would essentially be like as if you have the pager nested inside another horizontal scrolling container and want it to give up the touch events when it reaches it's end.
I've played with onMoveShouldSetResponderCapture and onStartShouldSetResponder setting them to false and doesn't work.
It does work when the swipeEnabled is set to false but need to figure out when to temporarily disable it. Has anyone figured out which callbacks to hook into to determine if we can temporarily disable the pager swiping.
+1
@Aryk hi, did you manage to solve this problem?
@rkritskiy did you find any alternative?
@rkritskiy No I have not, I just have to live with it right now...but would love to find a solution to it...would make for a better user experience. I've tried using a state, but not smooth enough...it really has to be handled on the native level.
I thought this was relevant, but didn't manage to get it working
https://github.com/callstack/react-native-pager-view/pull/500