-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Cell caching (while scrolling) is not working with WindowScroller #638
Comments
Good catch. I'm currently having performance issues with the WindowScroller as well. Until the pull request is merged, a temporary solution for the List might be
The only thing missing from the hack is (Grid.js)
|
Great issue write-up. Thanks for digging in and writing up a proposal.
These couple of slides give a little background info on the scaling issue. Basically I'm compressing positions and adjusting offset slightly as a user scrolls- so if I were to cache style (eg cache position) in this case, cells would get misaligned slightly during scroll. It's complicated. @dfdeagle47 is right that you can temporarily work around this by passing a decorated |
@bvaughn: thanks for the link, that slide deck is golden. |
👍 |
This change has been pushed via 9.5.0. Thanks for your help! |
Thank you! |
Just a heads-up for anyone who's still having a problem with rows re-rendering on each scroll even after passing the |
Problem: Scrolling with WindowScroller is sluggish, because all cells on screen are re-rendered on every scroll event. There is an internal caching mechanism that should work while scrolling, but not if WindowScroller is used.
defaultCellRangeRenderer checks for cell cache before rendering a cell, but only when isScrolling is true (also something about scaling?). If isScrolling == false, it will always re-render cells.
This is passed in from Grid::_calculateChildrenToRender, which reads isScrolling from Grid.state. Grid.state.isScrolling is only set true, when onScroll is called from div.ReactVirtualized__Grid.
If WindowScroller is used, Grid.state.isScrolling is always set to false.
Proposed solution: allow isScrolling to be overridden from Grid.props. That way any component which renders Grid (and they all pass ...this.props to Grid) can read isScrolling from WindowScroller, and pass that down. E.g.
Will make a pull request.
The text was updated successfully, but these errors were encountered: