You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Flatlist with initialScrollIndex will cause missing items #54409
If i have the initialScrollIndex set and the list is not bigger than the view (they all fit) then the items before initialScrollIndex will not render , it only works if i set disableVirtualization={true} but the order on how they are rendered doesnt seem right , for example if i have 8 items (and they all fit in the view) and i have set initialScrollIndex to 6th item with disableVirtualization={true} it will render 6 - 7 item first then the 0 to 5, if i dont disable it then it will only render item 6 and 7, if i have more items than they can fit in the view then it seems to work as expected.
Steps to reproduce
Set initialScrollIndex to any item excluding first one on a list that fits to the view.
Missing reproducer: We could not detect a reproducible example in your issue report. Reproducers are mandatory and we can accept only one of those as a valid reproducer:
For majority of bugs: send us a Pull Request with the RNTesterPlayground.js edited to reproduce your bug.
changed the title [-]Flatlist with initialScrollIndex will cause missing items with react native[/-][+]Flatlist with initialScrollIndex will cause missing items[/+]on Nov 4, 2025
Hi, I’d like to work on this issue. Could you please assign it to me? I’ve reviewed the description and would like to start investigating a fix for the initialScrollIndex behavior when the list fits within the view.
Thanks!
Hello,
I’d like to work on this issue related to FlatList and initialScrollIndex.
I’ve reviewed the problem description and tested the behaviour locally, and I’m interested in investigating a possible fix or providing a minimal reproducible example if needed.
Could you please assign this issue to me so I can start working on it?
@ish1416 everything is working fine if i set getItemLayout but if i dont set getItemLayout i cant scroll up , and in some situations if i scroll down the list will go at the start (without getItemLayout )
[TOO BIG formatValueCalls 333 exceeded limit of 200],
[TOO BIG formatValueCalls 334 exceeded limit of 200],
[TOO BIG formatValueCalls 335 exceeded limit of 200],
[TOO BIG formatValueCalls 336 exceeded limit of 200],
[TOO BIG formatValueCalls 337 exceeded limit of 200],
The list has A to Z items and the initialScrollIndex was set on W and it renders like this without getItemLayout set.
@ish1416 sadly it has the same problems without getItemLayout , i am using it in this project but i dont know how it will impact others that dont , i think we need more people to test this out, thanks for your effort.
Can confirm, I just encountered it in version 0.86.3. Is there a workaround for it? My initial attempt involved useEffect but that throws an error telling me to use initialScrollIndex.
Activity
react-native-bot commentedon Nov 4, 2025
Warning
Missing reproducer: We could not detect a reproducible example in your issue report. Reproducers are mandatory and we can accept only one of those as a valid reproducer:
You can read more about about it on our website: How to report a bug.
[-]Flatlist with initialScrollIndex will cause missing items with react native[/-][+]Flatlist with initialScrollIndex will cause missing items[/+]ish1416 commentedon Nov 5, 2025
Hi, I’d like to work on this issue. Could you please assign it to me? I’ve reviewed the description and would like to start investigating a fix for the
initialScrollIndexbehavior when the list fits within the view.Thanks!
izyspania commentedon Nov 5, 2025
Example with initialScrollIndex={4} , 7 items in total.
Only renders:
LOG Rendering TrackItem: 4 Pentru elevi
LOG Rendering TrackItem: 5 Reviste
LOG Rendering TrackItem: 6 Teatru
With initialScrollIndex={0} (or none)
With initialScrollIndex={4} but on a bigger list that doesnt fit into the view , this is the initial render order of items.
LOG Rendering TrackItem: 4 D
LOG Rendering TrackItem: 5 E
LOG Rendering TrackItem: 6 F
LOG Rendering TrackItem: 7 G
LOG Rendering TrackItem: 8 H
LOG Rendering TrackItem: 9 I
LOG Rendering TrackItem: 10 J
LOG Rendering TrackItem: 11 K
LOG Rendering TrackItem: 12 L
LOG Rendering TrackItem: 13 M
LOG ***onLayout event
LOG Rendering TrackItem: 1 A
LOG Rendering TrackItem: 2 B
LOG Rendering TrackItem: 3 C
LOG Rendering TrackItem: 14 N
LOG Rendering TrackItem: 15 O
LOG Rendering TrackItem: 16 P
LOG Rendering TrackItem: 17 Q
LOG Rendering TrackItem: 18 R
LOG Rendering TrackItem: 19 S
LOG Rendering TrackItem: 20 T
LOG Rendering TrackItem: 0 0
LOG Rendering TrackItem: 21 U
LOG Rendering TrackItem: 22 V
LOG Rendering TrackItem: 23 W
LOG Rendering TrackItem: 24 Y
LOG Rendering TrackItem: 25 Z
I tried different options but i couldnt fix this:
sanjana2505006 commentedon Nov 9, 2025
Hello,
I’d like to work on this issue related to FlatList and initialScrollIndex.
I’ve reviewed the problem description and tested the behaviour locally, and I’m interested in investigating a possible fix or providing a minimal reproducible example if needed.
Could you please assign this issue to me so I can start working on it?
ish1416 commentedon Nov 9, 2025
@izyspania You can review the PR now.
7 remaining items
ish1416 commentedon Nov 9, 2025
0fa10dd
izyspania commentedon Nov 9, 2025
@ish1416 everything is working fine if i set getItemLayout but if i dont set getItemLayout i cant scroll up , and in some situations if i scroll down the list will go at the start (without getItemLayout )
Edit: in console i also saw this warnings:
The list has A to Z items and the initialScrollIndex was set on W and it renders like this without getItemLayout set.
ish1416 commentedon Nov 9, 2025
@izyspania Lets fix this too
ish1416 commentedon Nov 9, 2025
@izyspania Can you check now its fixed i guess..
e6f1300
izyspania commentedon Nov 9, 2025
@ish1416 sadly it has the same problems without getItemLayout , i am using it in this project but i dont know how it will impact others that dont , i think we need more people to test this out, thanks for your effort.
ish1416 commentedon Nov 9, 2025
@izyspania Can you get this PR merge if possible this is for evaluation?
izyspania commentedon Nov 9, 2025
@ish1416 can i do that? sorry i dont really know what you want me to do, do you want me to create a Snack with a flatlist? I am using expo
ish1416 commentedon Nov 9, 2025
@izyspania How do i get this merge? I think you need to close the Issue with makreked as resolved such that my Pr gets merged
izyspania commentedon Nov 10, 2025
@ish1416 i am not sure if it works that way , did you manage to fix it when getItemLayout is not used?
DragomirAndrei19 commentedon Mar 27, 2026
This still happens in 2026, unfortunately...
react-native-bot commentedon Sep 23, 2026
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
DragomirAndrei19 commentedon Sep 23, 2026
Not stale
Belllene commentedon Oct 13, 2026
Can confirm, I just encountered it in version 0.86.3. Is there a workaround for it? My initial attempt involved
useEffectbut that throws an error telling me to useinitialScrollIndex.