Skip to content

[Bug]: initialScrollIndex on BottomSheetFlatList or BottomSheetFlashList does not work correctly #2026

@daniel-heg

Description

@daniel-heg

Version

v5

Reanimated Version

v3

Gesture Handler Version

v2

Platforms

iOS, Android

What happened?

When adding the initialScrollIndex prop to the BottomSheetFlatList with a value that is outside of the render distance (50 in the video), the flatlist is not rendered correctly.

If one starts to scroll, the flatlist will be rendered, but starts at the top of the list and not at the desired index.

If the initialScrollIndex is in the initial render distance (e.g. "2" in the snack), then the list will be rendered correctly, but the list also won't start from the given index.
So the error possibly might be in the scroll position at render time?

ScreenRecording_11-05-2024.13-22-04_1.MP4

Reproduction steps

add initialScrollIndex to the BottomSheetFlatList or BottomSheetFlashList with a value that is outside of the initial render distance

Reproduction sample

https://snack.expo.dev/@daniel.h/flatlist-bug-snack

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions