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

In the mobile browser, it will shake when scrolling to the top or bottom. #244

Closed
chenhebing opened this issue May 20, 2019 · 10 comments
Closed

Comments

@chenhebing
Copy link

Such as the title, list will shake when scrolling to the top or bottom, but react-virtualized is not happened.

You can view the video below.

video url

@bvaughn
Copy link
Owner

bvaughn commented May 20, 2019

This looks like Safari elastic scrolling and not something this library in particular is doing.

@blenoski
Copy link

I am observing similar behavior on Safari iOS (not seeing in Chrome iOS). FWIW, found a commit from react-virtualized that seems like it was related to this problem: https://github.com/bvaughn/react-virtualized/pull/616/files

@bvaughn
Copy link
Owner

bvaughn commented May 22, 2019

Want to try that out in react-window @blenoski ?

@blenoski
Copy link

@bvaughn
I will give it a try and report back to the issue.

I also have to update my comment 2 back, I was able to reproduce on Chrome iOS. Attaching a screen capture from iPhone7 for reference:
ios_scroll_bounce_issue

@bvaughn
Copy link
Owner

bvaughn commented May 22, 2019

Cool, thanks! 😁

@blenoski
Copy link

blenoski commented May 22, 2019

Update:
I did some quick hacking and was able to confirm that clamping scrollTop to [0, totalHeight - lastRowHeight] eliminates the observed flickering on iOS (this was in the _onScrollVertical function in createListComponent.js

It does require knowing the current height of the innerContainer element plus the height of the last row which I imagine will be the tricky part. Also, assuming similar issues would exist for horizontal scrolling but have not yet been able to reproduce the flickering there.

Anyhow, going to pull down the repo and dig into the code a little to see if I can figure this out :)

@blenoski
Copy link

Update (cc. @bvaughn)

Have a PR up here (#250).
Scoped the PR to just vertical scrolling on lists but I was able to verify it removes the issue shown in the GIF three posts back.

@EyMaddis
Copy link

I just noticed the same. This issue is basically this old react-virtualized issue.

@bvaughn
Copy link
Owner

bvaughn commented May 27, 2019

Worth noting that the linked RV commit was reverted in bvaughn/react-virtualized#616 so the long-standing RV solution to this is just to prevent scroll offsets less than 0. I think I'm comfortable making that change to RW as well, although I'll need to make sure it doesn't break RTL.

Also may be worth mentioning this comment:

I suspect that the bug lies somewhere within the iOS Webkit code and handling of the scroll bouncing events, but it is unclear. Disabling the bouncing on the scroll view at the wkwebview level does fixes the problem and produces a nice scrolling solution.

bvaughn pushed a commit that referenced this issue May 27, 2019
Fix elastic bounce issues and RTL issues
@bvaughn
Copy link
Owner

bvaughn commented May 28, 2019

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

No branches or pull requests

4 participants