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

fix: avoid jumping scroll position when upper item size is calculated #374

Merged
merged 3 commits into from
Oct 10, 2022

Conversation

ktsn
Copy link
Contributor

@ktsn ktsn commented Apr 1, 2020

extracted from #248
fix #248 (comment)

The original issue that #248 tried to solve is already solved on the current master branch but there still is an issue when upper items are loaded.

In the case the current scroll position is bottom and scrolling up, the upper items will be loaded and their size will be set lazily. When the size is set to concrete value, the remaining items will be pushed for bottom, then scroll looks jumpy.

To avoid this, I'm comparing prev and next height of items and add the offset to scrollTop.

@Akryum
Copy link
Owner

Akryum commented Apr 1, 2020

Won't this cause issues on touchscreens or touchpads with acceleration?

Co-Authored-By: Guillaume Chau <[email protected]>
@ktsn
Copy link
Contributor Author

ktsn commented Apr 1, 2020

There seems to be no problem on acceleration.
But I found iOS is still jumps on scrolling, will fix it.

@Akryum Akryum changed the base branch from master to v1 October 10, 2022 20:26
@Akryum Akryum merged commit fd58a95 into Akryum:v1 Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants