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

Sticky headers don't show correctly in Tabs.FlatList on iOS

Open abelmenkveld opened this issue 4 years ago • 10 comments

First of all, great job on this component! v4 added some really nice and necessary features for us.

Current behavior

When you use the stickyHeaderIndices prop on a FlatList, the sticky elements don't scroll up when the header collapses. This happens only on iOS.

Expected behavior

The sticky headers should scroll along the content and only stick when the header is fully collapsed. An alternative would be to add support for SectionLists.

Screenshots (if applicable)

https://user-images.githubusercontent.com/15447148/108208685-a58cd480-7129-11eb-97ba-ff46d5be7b8d.mov

abelmenkveld avatar Feb 17 '21 13:02 abelmenkveld

https://github.com/PedroBern/react-native-collapsible-tab-view/issues/97

alexpchin avatar Feb 17 '21 13:02 alexpchin

This seems like a side effect of using contentInset for content positioning.

contentInset is required so that the refresh control can be positioned underneath the header.

Unfortunately there's no other way on iOS to position the refresh control at the moment. There's a PR on it here: https://github.com/facebook/react-native/pull/30737

If that PR is merged to React Native we'll have a way around this.

One workaround would be to not use contentInset, but padding, like we do on Android. This would also close #122.

However, proper "below the header" refresh control positioning and sticky headers will not both work at the same time unless the upstream react-native PR is merged.

andreialecu avatar Feb 17 '21 14:02 andreialecu

Thank you for the clarification. That also explains why giving a ScrollView container top padding was only working on iOS and causing issues on Android ;). I don't use the refresh control but do like to have the iOS bounce effect below the header

abelmenkveld avatar Feb 17 '21 15:02 abelmenkveld

Hi! That React Native PR was merged. Are we able to use stickyHeaderIndices yet? Note this also applies to Tabs.ScrollView.

damassi avatar May 23 '23 17:05 damassi

@damassi - feel free to play with the example app to see if it works now. If you need to make any modifications to the library, PRs are welcome. Please take a look at the CONTRIBUTING document as well.

andreialecu avatar May 24 '23 11:05 andreialecu

in v6.2.0 still exist this issue. Checked on Tabs.SectionList 😢

Vitalik7 avatar Aug 03 '23 20:08 Vitalik7

Hi I have unexpected behavior regarding SectionList

image

the sections are inverted

jonathanm-tkf avatar Aug 17 '23 21:08 jonathanm-tkf

yeah the issue persists, im on the latest everything

frozencap avatar Sep 20 '23 19:09 frozencap