scrollToRow on List with dynamic heights and CellMeasurer doesn't always scroll to the proper location
See original GitHub issueOn a List with many items, all of dynamic height that are measured using a CellMeasurer, sometimes, jumping to a smaller row index n
from larger row m
index fails. This more frequently happens when m is much larger than n.
Here’s a plunkr to reproduce this behavior: https://plnkr.co/edit/B1463DyuByuIlmWTynRn
Steps:
- Enter a number between 600-800 in the box, and hit “Jump to row…”
- Enter a number between 200-400 in the box, and hit “Jump to row…”. Check whether the row is visible.
- Repeat steps 1 and 2, using a different number in the ranges each time, until you notice that the row in step 2 isn’t visible after the jump.
It usually takes anywhere from 1-5 repetitions for it to first occur. I’ve also noticed the error occurs with decreasing frequency the more jumps are done.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:22
- Comments:16 (1 by maintainers)
Top Results From Across the Web
scrollToRow result is off for dynamic height list - Stack Overflow
I think there's a misunderstanding or two above. Firstly, calling cache.clearAll() will erase all measurements- requiring CellMeasurer to ...
Read more >A brand new website interface for an even better experience!
scrollToRow on List with dynamic heights and CellMeasurer doesn't always scroll to the proper location.
Read more >List Virtualization - Patterns.dev
It's a windowing library by Brian Vaughn that renders only the items currently visible in a list (within a scrolling "viewport"). This means...
Read more >types/react-virtualized@9.21.21 - jsDocs.io
This improves performance and makes scrolling smoother. ... scrollToRow: 0; ... list of elements with either fixed or dynamic heights.
Read more >react-virtualized | Yarn - Package Manager
React components for efficiently rendering large, scrollable lists and tabular data. react, reactjs, react-component, virtual ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have solution
You should do scroll until row index is >= startIndex and <= stopIndex scrollTop can be found by List#getOffsetForRow
I have the same issue, my workaround is to call
scrollToRow
again in thesetState
callback, like: