Skip to content

FlatList content disappears if bottom tab change during momentum scroll #1473

Closed
@noumantahir

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

  1. Drag flat list,
  2. Quickly change bottom tab while list is in momentum scroll
  3. Come back to FlatList tab
  4. 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

Metadata

Assignees

No one assigned

    Labels

    BugBash 31.03Close when staleThe issue will be closed automatically if it remains inactive

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions