Skip to content

initialScrollIndex and estimatedFirstItemOffset don't work together #671

Open
@david-arteaga

Description

@david-arteaga

Current behavior

When providing both initialScrollIndex and estimatedFirstItemOffset, the content is not scrolled the right amount. The estimatedFirstItemOffset value is ignored.

This is the recording from this snack: https://snack.expo.dev/@david.arteaga/faulty-initialscrollindex-with-estimatedfirstitemoffset
The initialScrollIndex is set to 3, so the Item 3 item should be at the top of the list, but it's not.

RPReplay_Final1668051117.MP4

If the header is removed then initialScrollIndex behaves as expected.

Expected behavior

The estimatedFirstItemOffset should be considered when calculating the initial offset when initialScrollIndex is provided.

To Reproduce

Run this snack on iOS:
https://snack.expo.dev/@david.arteaga/faulty-initialscrollindex-with-estimatedfirstitemoffset

Platform:

  • iOS
  • Android

I have not tested on Android.

Environment

1.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions