PedroBern / react-native-collapsible-tab-view

A cross-platform Collapsible Tab View component for React Native
MIT License
834 stars 162 forks source link

Children Flatlist with horizontal direction not working #92

Closed tcorreiaubi closed 3 years ago

tcorreiaubi commented 3 years ago

Current behavior

Configuring a flatlist with horizontal direction on a Tab.ScrollView is not working as expected, the content is being displayed vertically instead of horizontally

Expected behaviour

The Content to be displayed in the horizontal direction

Code sample

https://github.com/tcorreiaubi/CollapsibleTabViewsDemo

Screenshots (if applicable)

What have you tried

tcorreiaubi commented 3 years ago

@PedroBern Hey, sorry to bother, im a bit stuck on this one, not sure if this is caused because of the tabs being wrapped on a flatlist with horizontal direction

PedroBern commented 3 years ago

No worries :)

Yes maybe, I'm not sure, didn't have the time to test. Try to add nestedScrollEnabled={true}

tcorreiaubi commented 3 years ago

Didn't work, strange enough, if I use a scrollview instead of a flatlist as child the content is displayed correctly, im confused

tcorreiaubi commented 3 years ago

I was able to get it working by disabling the scroll on the pagerProps and rendering a Tabs.Flatlist instead of scrollview and also passing the content as the prop ListEmptyComponent, feels kinda hacky, but I believe the issue is related with nesting a flatlist in the same direction, Tabs.container(aka horizontal flatlist) > Tabs.ScrollView/Tabs.Flatlist(vertical) > View > Flatlist horizontal There was also some scenarios where I would lose the ref of nested flatlists

Just leaving the issue open to hear what you think about it, but feel free to close it if there's nothing to be added

andreialecu commented 3 years ago

See #163 for the same issue and a workaround.

habovh commented 3 years ago

@andreialecu same issue yes but a workaround is no fix. In my opinion one of these issues should remain open and deserves more attention.