react-native-collapsible-tab-view
react-native-collapsible-tab-view copied to clipboard
Tabs.Scrollview breaks with Reanimated 2.3.0
Hello,
I upgraded my project to reaniamted 2.3.0 and it seems to break Tab.ScrollView
. Tabs.Sectionlist
and Tabs.Flatlist
are working perfectly fine, as you can see in the video. Here is the video from the example app where I upgraded reaniamted.
https://user-images.githubusercontent.com/61253912/145680411-20bf2cc5-f044-48a0-8a5b-124efa105f40.mp4
I went through the sourcecode and found the issue is with onGliding
on Tabs.ScrolllView
not becoming false
again after the scroll ended. So this condition always returns true
.
https://github.com/PedroBern/react-native-collapsible-tab-view/blob/01b5a5a37675300921a2351e98eb4648bff2a7a8/src/Container.tsx#L389
When I outcomment this line https://github.com/PedroBern/react-native-collapsible-tab-view/blob/01b5a5a37675300921a2351e98eb4648bff2a7a8/src/hooks.tsx#L417 this is the new behaviour:
https://user-images.githubusercontent.com/61253912/145680710-ca047abe-c421-4429-ba17-d3bbcd331e29.mp4
This breaks the snapping functionality for the Tabs.Scrollview
though.
I will investigate further. Do you @andreialecu and @PedroBern have any idea what the problem might be. There seems to be some change to Animated.ScrollView
in the new rea version. Would be happy to get some insights, if you have any. :)
I investigated further. To share my current progress. It seems like onMomentumEnd
is not being called when using a ScrollView
.:
https://github.com/PedroBern/react-native-collapsible-tab-view/blob/01b5a5a37675300921a2351e98eb4648bff2a7a8/src/hooks.tsx#L442
Really weird. Seems like there is some sort of change in the API for ScrollView
for Reanimated 2.3.0
I've just noticed this too using Reanimated 2.3.1
@khlling yes that is a bug introduced with rea 2.3.0. I created an issue describing the bug. So far I haven't heard back from the maintainers of rea.
Hi @alexco2,
I know its different question but can you help me out with this issue. How to use this lib with RecyclerListView ?
@siddharth-kt Sorry, I have no idea. But isn´t recyclerlistview just for web? I would suggest you to fork this repo and try to implement it. If RecyclerListView extends ScrollView, this sould be easy. If it works the community would really appreciate a pull request. I bet @andreialecu and @PedroBern would be happy to merge it. Besides that, please keep the comments in the respective issues. Else it gets cluttered fast. Thank you.
@alexco2
But isn´t recyclerlistview just for web?
- It works on mobile too.
I would suggest you to fork this repo and try to implement it.
- Ok, I will try.
Besides that, please keep the comments in the respective issues. Else it gets cluttered fast.
- Yeah, I understand this, I was expecting that you will answer me in mentioned issue 😅.
Thanks
I am experiencing the same issue as described by the OP. However I would like to add that this only happens on Android. It works fine on Apple devices.
onMomentumEnd and couple of events are broken currently with Reanimated when using ScrollView. I also created issues upstream for this, and there are still some unanswered other requests already.
Hi guys, I'm using Tabs.Flatlist for infinity scroll. However, the onMomentumScrollBegin event never gets fire. Any helps please? Thank you guys
@andreialecu Is there any update on this? Following the thread (https://github.com/software-mansion/react-native-reanimated/issues/1699), I noticed that your upstream issue was closed and you were asked to open a discussion. But I lost the trail from there.
I upgrading to the latest react-native-reanimated v2.4.1 with react-native-collapsible-tab-view v4.5.2 but to no affect.
The upstream issue is https://github.com/software-mansion/react-native-reanimated/issues/2735 which doesn't seem to be resolved.
Suggest staying on reanimated 2.2.x
for now.
@andreialecu thanks! Will keep an eye on the upstream issue.
The upstream issue https://github.com/software-mansion/react-native-reanimated/issues/2735 seems to be low priority for software mansion. If everyone affected by this issue could upvote it, perhaps we will get some attention. Thanks