Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regressions: v5 RC breaks all touchables by react-native-gesture-handler in FlatList #256

Closed
hirbod opened this issue May 6, 2022 · 17 comments
Labels
enhancement New feature or request

Comments

@hirbod
Copy link

hirbod commented May 6, 2022

@andreialecu I can tell you that I've upgraded and the first thing I realized is that that new release is breaking the swipe behavior in my view. I can only swipe tabs now when I place my finger on the tabs directly or when I swipe in the header area or on a view that does not use touchables by RNGH.

It does not play nicely with RectButton, BaseButton etc by react-native-gesture-handler anymore. It does work with RN-Touchables (which should not be used in FlatLists anyway, because they don't work nicely with FlatList, activating with scroll which they should not)

It does work with TouchableOpacity, TouchableWithoutFeedback etc (from react-native) though
v4 did not had any issues with RectButton

P:S: Can't select "issue" as "issue", only Feature Requests and Questions.

@hirbod hirbod added the enhancement New feature or request label May 6, 2022
@hirbod hirbod changed the title Bug: v5 RC breaks all touchables by react-native-gesture-handler in FlatList Regressions: v5 RC breaks all touchables by react-native-gesture-handler in FlatList May 6, 2022
@hirbod
Copy link
Author

hirbod commented May 6, 2022

It does also break the workaround used here: #248

@hirbod
Copy link
Author

hirbod commented May 6, 2022

Other regressions:

  • useTabsContext must be inside a Tabs.Container.
  • useTabNameContext muss be inside a TabNameContext

I am not even using this. Its coming from the FlatList Implementation.

@andreialecu
Copy link
Collaborator

andreialecu commented May 6, 2022

It does also break the workaround used here: #248

Fixed this in v5.0.0-rc.5

@andreialecu
Copy link
Collaborator

The RNGH issue is odd. Must be something about react-native-view-pager and react-native-gesture-handler not playing nicely with each other. Wasn't able to find anything related to that in their issue trackers. 🤔

@andreialecu
Copy link
Collaborator

Other regressions:

  • useTabsContext must be inside a Tabs.Container.
  • useTabNameContext muss be inside a TabNameContext

I am not even using this. Its coming from the FlatList Implementation.

Need a repro for this or more details. Nothing related to that should've changed. 🤔

@hirbod
Copy link
Author

hirbod commented May 6, 2022

For now (with a broken heart), I swapped RectButton with TouchableWithoutFeedback.
I really did nothing but upgrading and got those weird TabNameContext issues. Could not reproduce that after upgrade to RC.4 for now - weird (maybe metro bundle cache or some node_modules weirdness again when working with monorepos)

Ok, whats left is RNGH :/

@andreialecu
Copy link
Collaborator

If you'd like to help out to figure out if there are any workarounds, or the reason for the RNGH issue it would be greatly appreciated.

@hirbod
Copy link
Author

hirbod commented May 6, 2022

Are you importing Flatlist from RN or from RNGH? Usually it's enough to use Flatlist by RNGH to get rid of touchable issues (it's also preferred when working with gestures).

@andreialecu
Copy link
Collaborator

I briefly tested the RNGH flatlist and it didn't make any difference.

@hirbod
Copy link
Author

hirbod commented May 6, 2022

Hm... dang. I'm also seeing my items disappear sometimes now, like when you use removeClippedSubviews. It happens very randomly, have to investigate further

@hirbod
Copy link
Author

hirbod commented May 6, 2022

I made a repro case and its indeed an issue with pager-view vs rngh
https://snack.expo.dev/@hirbod/pager-view---rngh-touchables-issue

The green area is swipeable and the yellow one not. Only the third yellow box works because its using TouchableHighlight from RN

@hirbod
Copy link
Author

hirbod commented May 6, 2022

Not happening on android btw, its iOS only

@andreialecu
Copy link
Collaborator

The issue might be caused by RNGH and not pager view. Try opening an issue on that side too.

@hirbod
Copy link
Author

hirbod commented May 6, 2022

I filed an issue at both repos
software-mansion/react-native-gesture-handler#2043
callstack/react-native-pager-view#554

@hirbod
Copy link
Author

hirbod commented May 8, 2022

Just figured that containerStyle is also not working with the new RC. Had to make small adjustments

@hirbod
Copy link
Author

hirbod commented May 18, 2022

My PR has been merged, it was an issue with pager-view. A new version has been released. Touchables should work with 5.4.17

@anabeatrizzz
Copy link

Other regressions:

  • useTabsContext must be inside a Tabs.Container.
  • useTabNameContext muss be inside a TabNameContext

I am not even using this. Its coming from the FlatList Implementation.

I was facing the same issue. The error disappeared after I changed Tabs.ScrollView for Animated.ScrollView.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants