Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested FlatList does not scroll #15375

Closed
juanamd opened this issue Aug 4, 2017 · 32 comments
Closed

Nested FlatList does not scroll #15375

juanamd opened this issue Aug 4, 2017 · 32 comments
Labels
Bug Component: FlatList Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@juanamd
Copy link

juanamd commented Aug 4, 2017

Is this a bug report?

Yes

Have you read the Bugs section of the How to Contribute guide?

Yes

Environment

  1. react-native -v:
    react-native-cli: 2.0.1
    react-native: 0.47.1
  2. node -v:
    v7.10.0
  3. npm -v:
    v7.10.0
  4. yarn --version:
    0.27.5

Then, specify:

  • Target Platform: Android
  • Development Operating System: Windows 10 Pro
  • Build tools: Not using Xcode nor Android Studio to build native code. Have only tried this on Android.

  • Comments: This worked fine with RN 0.44 until yesterday when I updated to RN 0.47 and I noticed that the sublists on my app stopped working.

Steps to Reproduce

(Write your steps here:)

  1. Add a FlatList (vertical scroll) component with some data.
  2. Have the renderItem prop be a function which returns another FlatList component (also with vertical scroll)
  3. Let the nested FlatList have a constrained height

Expected Behavior

Both lists (parent and children) would be able to scroll (as it did with RN v0.44)

Actual Behavior

Only the parent FlatList scrolls.

Reproducible Demo

https://snack.expo.io/HJSueSfPZ

@juanamd juanamd changed the title Nested FlatList do not scroll Nested FlatList does not scroll Aug 5, 2017
@keithcml
Copy link

same here, any updates???

@jasongonzales23
Copy link

+1

1 similar comment
@Rpeanut
Copy link

Rpeanut commented Sep 2, 2017

+1

@denisftw
Copy link

denisftw commented Sep 3, 2017

I have the same issue, but I didn't know that it worked on 0.44. Hopefully, someone will come up with a workaround. This definitely works when the nested FlatList is inside the ListView, I wonder why FlatList is different.

@arminsal1
Copy link

Anyone find any solutions or hack-arounds? I'm facing the same issue

@hellereye
Copy link

I have the same issue

@dotansimha
Copy link

For me it works after adding contentContainerStyle={{ flexGrow: 1}} to the list, and style={{ flex: 1}} to the container. using rn>0.49.3

@tomdixon
Copy link

tomdixon commented Nov 22, 2017

Same issue for me. I've noticed that the complete content of the inner FlatList appears to render outside of the bounds of the FlatList itself, and therefore no scrolling occurs as it has all been rendered. I noticed this by hiding some of the elements after the nested FlatList element.

@congsuboya
Copy link

+1

@alex1815
Copy link

alex1815 commented Dec 9, 2017

From documentation: "Also inherets ScrollView Props, unless it is nested in another FlatList of same orientation", https://facebook.github.io/react-native/docs/0.48/flatlist.html

@monkingame
Copy link

+1 same issue.
I have to use 'Click More' button if there isn't any solution yet.

@hramos hramos added the Lists label Mar 8, 2018
@tuncaulubilge
Copy link
Contributor

#18299 aims to fix this issue on Android 21 and above.

@SSTPIERRE2
Copy link

@alex1815 Hey I read that too, but I don't quite understand the implications, do you? So a nested FlatList doesn't inherit ScrollView props, does that mean it's not possible for the FlatList to scroll independent from the outer ScrollView?

@boris-burgos
Copy link

+1

@ionush
Copy link

ionush commented May 31, 2018

+1

@alz10
Copy link

alz10 commented Jun 4, 2018

Any fix for this?

@tandat2209
Copy link

+1

1 similar comment
@gurleen-kaur-30
Copy link

+1

@Balasnest
Copy link

I am still facing this issue. Any solution for this problem?

@CaioPaiola
Copy link

+1

@Danishkhan007
Copy link

Danishkhan007 commented Jul 21, 2018

I had the same issue, I resolved this by giving my Parent View, style: {{flex: 1}}, give the same style of flex 1 to all the views that on the top of your flatlist.
This works.

@vitorolivg
Copy link

In my case, it works adding a height, style: {{ height }}.

@MarcBrout
Copy link

Could you guys @Danishkhan007 or @vitorolivg post some working code please ? I'm currently pulling my hair off with this workaround...

@tuncaulubilge
Copy link
Contributor

@MarcBrout did you try "nestedScrollEnabled" prop in ScrollView (available in react-native 0.56.0+)
https://facebook.github.io/react-native/docs/scrollview#nestedscrollenabled

@MarcBrout
Copy link

@tuncaulubilge I can't upgrade my project to 0.56.0 right now, but I implemented this workaround #1966 (comment) and it works out !

@webbin
Copy link

webbin commented Oct 13, 2018

+1

@est7
Copy link

est7 commented Nov 7, 2018

@MarcBrout outer component is scrollview ,if i replaced with flatlist , nested flatlist cant work

@alexpchin
Copy link

Any update on this?

@pavermakov
Copy link

+1

1 similar comment
@sorinns
Copy link

sorinns commented Feb 26, 2019

+1

@stale
Copy link

stale bot commented Aug 4, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Aug 4, 2019
@stale
Copy link

stale bot commented Aug 11, 2019

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Aug 11, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Aug 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Component: FlatList Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
No open projects
New List Views
Awaiting triage
Development

No branches or pull requests