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

Relative relayouting #1192

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Relative relayouting #1192

wants to merge 18 commits into from

Conversation

irisjae
Copy link

@irisjae irisjae commented May 8, 2024

Description

When the list enters a region with bad size estimates, scrolling becomes incredibly choppy, appearing to the user as if the list content is jumping around as the user scrolls.

Another issue is that the list is not able to maintain the visible content position when the provided data changes.

This patch implements a relative relayouting algorithm both in native and in RecyclerListView, and solves these problems. Here is a longer analysis of the problem and solution.

Hopefully, this mechanism can be part of FlashList.

Relevant issues:

Relevant PRs:

Reviewers’ hat-rack 🎩

  • Accurate initialRenderIndex
  • Accurate scroll methods
  • Allows list to maintain position across data changes
  • Allows list to not jump when estimated sizes are badly off
  • Allows list to not jump when layouts before visible position change

Screenshots or videos (if needed)

Checklist

@zulfio
Copy link

zulfio commented May 10, 2024

Tested, it's working fine. It's not choppy when scrolling up.

@erquhart
Copy link

@naqvitalha this PR looks to address a major issue for the library. Any chance of it getting reviewed?

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

Successfully merging this pull request may close these issues.

3 participants