question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug][ios] Touchables (all of them, including RectButton etc) prevent swiping in PagerView from react-native-pager-view

See original GitHub issue

Description

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

  1. 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:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
j-piaseckicommented, May 12, 2022

I believe this may be the problem with react-native-pager-view, specifically this line. After changing it to delaysContentTouches = YES, the code from snack seems to be working as intended (that is, you can swipe between screens).

0reactions
hirbodcommented, May 18, 2022

This was fixed upstream!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found