-
-
Notifications
You must be signed in to change notification settings - Fork 771
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
White spaces while scrolling in FixedSizeList with heavy Rows (8 Material UI cards in a row) #116
Comments
This type of white space when scrolling first starts is, unfortunately, a necessary trade-off made with the windowing techniques used by this library. Unless we were to force scroll handlers to be sync– (which would just make the scrolling feel slow and janky to the user)– then we can't avoid this entirely. Some things you can do:
|
@bvaughn - I work with @ashishgupta1989 and found that if I disable the chrome flag "Smooth Scrolling" then performance is great. How would we go about making the scroll handler synchronous? I tried wrapping the setState in _this._onScrollVertical() with a requestAnimationFrame() but it didn't have the same impact as the flag change. I would love to be able to just set a scrollSync flag on the component to get the same behavior. |
So this works:
It was inspired by this stack overflow answer: https://stackoverflow.com/questions/12747746/how-to-disable-smooth-scrolling-in-chrome If I submit a pull request with a new prop scrollSync that hooks up this fix, would you accept it? |
You're always welcome to submit pull requests for consideration. I'll admit that forcing scroll event handlers to be blocking is something that I probably don't want to add support for to the API, but I'll read the PR and give it consideration. |
Hi,
Thank you for this amazing library.
I am facing issues when the Row component is heavy while using FixedSizeList. I am getting white spaces when scrolling very fast using the trackpad.
I have put a demo to illustrate this issue (our actual cards are much heavier than the ones used in the demo) - https://codesandbox.io/s/n746q40970 / https://n746q40970.codesandbox.io/
I am rendering 8 material UI cards within a single row and I can see white spaces while scrolling, but when I use 1 or 2 cards I do not see these white spaces.
Can you please help figure out how to handle this scenario?
Thanks
Ashish
The text was updated successfully, but these errors were encountered: