镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

FlatList getItemLayout scroll jumps with dynamic heights #31510

Description

@rrebase

Description

Implemented getItemLayout for a large list with dynamic heights in order to scroll outside of the render window with scrollToIndex, but the scrolling starts jumping when scrolling past the midpoint of a large list.

Likely related if the issue is with VirtualizedList: #31163

Seems like a 🐛 as the small amount of docs that exist for getItemLayout suggest that this is a valid use case.

React Native version:

"react-native": "0.64.1"

Steps To Reproduce

  1. Create a FlatList with getItemLayout that has dynamic heights & a large amount of rows
  2. Scroll to the bottom part of the list until you see the scroll position unexpectedly jump back to the top part of the list

Expected Results

Scrolling the list past the 300th row in the Snack on iOS device does not jump back to 150th row & there's no flickering.

Snack:

https://snack.expo.io/HQaYpJjAn (100% reproducable on iOS device)

Activity

  1. heyItsRDomi commented on Apr 21, 2023

    @heyItsRDomi

    I've encountered the same issue (IOS and Android).

    React Native Version: 0.66.5

  2. agunbuhori commented on Oct 6, 2023

    @agunbuhori

    Description

    Implemented getItemLayout for a large list with dynamic heights in order to scroll outside of the render window with scrollToIndex, but the scrolling starts jumping when scrolling past the midpoint of a large list.

    Likely related if the issue is with VirtualizedList: #31163

    Seems like a 🐛 as the small amount of docs that exist for getItemLayout suggest that this is a valid use case.

    React Native version:

    "react-native": "0.64.1"
    

    Steps To Reproduce

    1. Create a FlatList with getItemLayout that has dynamic heights & a large amount of rows
    2. Scroll to the bottom part of the list until you see the scroll position unexpectedly jump back to the top part of the list

    Expected Results

    Scrolling the list past the 300th row in the Snack on iOS device does not jump back to 150th row & there's no flickering.

    Snack:

    https://snack.expo.io/HQaYpJjAn (100% reproducable on iOS device)

    only works for static heights, and is problematic if each items height is different

  3. github-actions commented on Apr 4, 2024

    @github-actions

    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.

  4. added
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    on Apr 4, 2024
  5. github-actions commented on Apr 11, 2024

    @github-actions

    This issue was closed because it has been stalled for 7 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Triage 🔍StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions