6

Nested FlatList is not scrolling if it has the same orientation as it's parent FlatList. Is this a bug?

4 Answers 4

17

Try using FlatList from react-native-gesture-handler as nested.

import { FlatList } from 'react-native-gesture-handler'
Sign up to request clarification or add additional context in comments.

5 Comments

Why this one works but not the basic one ?
You're my hero!
Damn, man! 2 days of trying to fix and this was the solution. The issue with 'react-native' flatlist still persists.
Perhaps the main reason why it only worked with FlatList imported from gesture handler library is that it wrapped with NativeViewGestureHandler component: docs.swmansion.com/react-native-gesture-handler/docs/1.x/…
This worked for me too!
1

You need to set nestedScrollEnabled prop - https://reactnative.dev/docs/scrollview#nestedscrollenabled

2 Comments

I tried it but it only works if their orientation is different.
Sorry I missed the same orientation part. Scrolling won't work as you expected for nested FlatList. I think what you are looking for is SectionList. Or maybe if you can setup some example on snack.expo.io, that will helpful for me to give more suggestions.
0

Old question, but still an issue... If you wrap the inner FlatList in a ScrollView then it'll scroll.

After doing this I've had issues getting the inner FlatList to respond to refreshing and onEndReached (because it doesn't actually scroll itself) but depending on your use-case this might not be too much of an issue.

Comments

-1

import { FlatList } from 'react-native-gesture-handler'

Issue link - https://github.com/facebook/react-native/issues/15375

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.