FlatList is not scrollable inside TabView
See original GitHub issueExplain what you did (Required)
Using TabView
and TabView.Item
, containing a list inside the TabView.Item
.
Expected behavior (Required)
The list inside the TabView
should continue to be scrollable.
Describe the bug (Required)
When having a FlatList
inside a TabView.Item
, the scrolling of the list is broken - you can only scroll if you very quickly swipe the screen.
To Reproduce (Required) I created this Snack: https://snack.expo.io/2K8V8ALHy
You will notice that, in the browser, everything seems to work. If you actually use Expo GO and scan the app to run it on your device, you will be able to reproduce the bug - not being able to scroll the list in the first tab.
Screenshots (Required)
Your Environment (Required):
software | version |
---|---|
react-native-elements | 3.4.2 |
react-native | Expo 40 |
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:24 (5 by maintainers)
Top Results From Across the Web
Flat List Not Scrolling in TabView (React Native Elements)
Under the TabView, I have a FlatList , the list appears but it is not able to scroll, I have tried implementing flex:...
Read more >ScrollView - React Native
This is where FlatList comes into play. FlatList renders items lazily, when they are about to appear, and removes items that scroll way...
Read more >react-native-tab-view - npm
Smooth animations and gestures; Scrollable tabs ; Custom Tab Bar · Lazy Load ; index : a number representing the index of the...
Read more >Common bugs in React Native ScrollView and how to fix them
Because FlatList only renders elements that are currently showing on the screen — not all the elements at once — it is capable...
Read more >react-native-scrollable-tab-view - Bountysource
The items of FlatList are wrapped inside a TouchableWithoutFeedback with onPress property. Scrolling vertical (witch is FlatList responsible for) is OK and the ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Now, it works on android but in ios, the scroll is buggy and not work as expected if you try the same code but on an ios device, it won’t work.
Edit: It can be “fixed” with the following code, but the swipe left/right to move between tabs stops working. I think I will use this approach for now, when this bug is fixed I will roll back my solutions.
<TabView.Item onMoveShouldSetResponder={(e) => e.stopPropagation()}>
I have same issue, I found a tempo solution by creating VirtualizedView component because 2 scroll in the same orientation will throw a warning and put the tabView inside it also used @ruiaraujo012 solution for better performance
hope it helps