Shopify / flash-list

A better list for React Native
https://shopify.github.io/flash-list/
MIT License
5.61k stars 283 forks source link

Separators not rendered when adding more items to bottom of a list #633

Open sahil-ahuja-1 opened 2 years ago

sahil-ahuja-1 commented 2 years ago

I'm seeing a bug as follows with ItemSeparatorComponent

I have a list of 10 items with separators in between. I append 10 more items to the list with pagination. The 10th item (previously the last item) doesn't show an item separator between it and the 11th item after adding the additional items to the list. When I scroll far enough down to recycle the view and scroll back up, the separator shows

fortmarek commented 1 year ago

Please, provide reproduction steps for this.

mk-nickyang commented 1 year ago

@fortmarek I made a reproduction snack here, let me know if there is anything else you need https://snack.expo.dev/@lucissa/list-separator-not-rendered-when-adding-more-items

anatooly commented 1 year ago

Yeap, ItemSeparatorComponent render logic at FlatList not equal as FlashList. lastEl -1 not have separator from lastEl. Add separator for position ListHeaderComponent when use inverted prop, strange.

for example use all prop

interted
ItemSeparatorComponent={() => <View style={styles.itemSeparator} />}
ListHeaderComponent={() => <View style={styles.itemSeparator} />}
ListFooterComponent={() => <View style={styles.itemSeparator} />}

on FlatList we has space top/bottom/and between all cell onFlashList top/2 space on bottom/between cell without last two cells (on top by inverted).

Code-Victor commented 1 month ago

Good day, any progress on this? I'm still facing this issue