react-native-collapsible-tab-view icon indicating copy to clipboard operation
react-native-collapsible-tab-view copied to clipboard

Tabs.Scrollview breaks with Reanimated 2.3.0

Open alexco2 opened this issue 2 years ago • 13 comments

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. :)

alexco2 avatar Dec 11 '21 14:12 alexco2

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

alexco2 avatar Dec 12 '21 15:12 alexco2

I've just noticed this too using Reanimated 2.3.1

khlling avatar Dec 19 '21 22:12 khlling

@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.

alexco2 avatar Dec 20 '21 01:12 alexco2

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 avatar Dec 24 '21 14:12 siddharth-kt

@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 avatar Dec 24 '21 17:12 alexco2

@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

siddharth-kt avatar Dec 24 '21 17:12 siddharth-kt

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.

azwinlam avatar Jan 07 '22 08:01 azwinlam

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.

hirbod avatar Jan 15 '22 13:01 hirbod

Hi guys, I'm using Tabs.Flatlist for infinity scroll. However, the onMomentumScrollBegin event never gets fire. Any helps please? Thank you guys

anhquan291 avatar Feb 17 '22 16:02 anhquan291

@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.

khlling avatar Mar 04 '22 22:03 khlling

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 avatar Mar 05 '22 09:03 andreialecu

@andreialecu thanks! Will keep an eye on the upstream issue.

khlling avatar Mar 05 '22 13:03 khlling

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

alexco2 avatar Apr 21 '22 09:04 alexco2