Melbius
Melbius

Reputation: 11

Disable react-native-tab-view swipe on area covered by nested FlatList

I have a FlatList embedded in every screen of a react-native-tab-view, and I would like to disable the swipe of the react-native-tab-view in the area covered by this FlatList for a better user experience.

When reaching the end of the FlatList, the scroll propagates to the parent react-native-tab-view

GIF example of the scroll propagating to tab view

On Android, the scroll in this area is even sometimes considered as a swipe on the react-native-tab-view, which leads to hard times scrolling the FlatList.

I tried to find a way to catch touch events and stop propagation but I'm not very familiar with PanResponders and touch events captures.

Upvotes: 1

Views: 927

Answers (1)

siicieco
siicieco

Reputation: 1

Just use

    <TabView
      .....
      swipeEnabled={false}
    />

Upvotes: -2

Related Questions