FlatList content disappears if bottom tab change during momentum scroll #1473
Closed
Description
Description
When flatlist is in momentum scroll, list content disappears if tab is changed using bottom navigation and come back to initial tab. The content immediately comes back on any interaction with flatlist.
Screenshots
Screen.Recording.2021-05-24.at.4.36.43.PM.mov
Steps To Reproduce
- Drag flat list,
- Quickly change bottom tab while list is in momentum scroll
- Come back to FlatList tab
- content is disappeared
<FlatList
ref={flatListRef}
data={posts}
showsVerticalScrollIndicator={false}
renderItem={_renderItem}
keyExtractor={(content, index) => `${content.author}/${content.permlink}-${index}`}
removeClippedSubviews
onEndReachedThreshold={1}
maxToRenderPerBatch={9}
initialNumToRender={9}
windowSize={15}
onEndReached={_onEndReached}
onMomentumScrollBegin={() => {
_onEndReachedCalledDuringMomentum = false;
}}
/>
const _renderItem = ({ item, index }:{item:any, index:number}) => {
return (
<PostCard
key={`${item.author}-${item.permlink}`}
content={item}
/>
};
Package versions
- React:16.9.0
- React Native:0.61.0
- React Native Gesture Handler:1.9.1
- react-navigation-tabs: 2.6.2