[bug][ios] Touchables (all of them, including RectButton etc) prevent swiping in PagerView from react-native-pager-view
See original GitHub issueDescription
When you use a Flatlist you will most likely import touchables from react-native-gesture-handler, I can’t use them with react-native-pager-view
because it breaks swiping. Guess there is some racing with the gestures going on. iOS only.
And yes, I tried NativeViewGestureHandler
with disallowInterruption
true/false and my App is wrapped with the RootView Component.
Platforms
- iOS
- Android
- Web
Screenshots
Steps To Reproduce
- Check my snack
Expected behavior
Swiping should be possible
Actual behavior
Swiping not possible
Snack or minimal code example
https://snack.expo.dev/@hirbod/pager-view---rngh-touchables-issue?platform=ios
The green area is swipeable, the yellow area is not. Only the last one on Slide 3 is swipeable because it does use TouchableHighlight from react-native to demonstrate that this issue is caused by RNGH.
Package versions
- React: 17.0.2
- React Native: 0.68.1
- React Native Gesture Handler: 2.4.2
- React Native Reanimated: 2.8.0
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How do disable paging by swiping with finger in ViewPager ...
To enable / disable the swiping, just overide two methods: onTouchEvent and onInterceptTouchEvent . Both will return "false" if the paging was disabled....
Read more >react-native-pager-view prevent onPageSelected ... - Reddit
I'm working on a react-native project and i'm looking for a way to execute a function when the user swipes between pages contained...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe this may be the problem with
react-native-pager-view
, specifically this line. After changing it todelaysContentTouches = YES
, the code from snack seems to be working as intended (that is, you can swipe between screens).This was fixed upstream!