VirtualScroll should honor row keys
See original GitHub issueRight now, VirtualScroll
uses Grid
which generates its own element keys. While this works nice in most cases, having surrogate keys creates a mess once you start shifting the entries (e.g., by inserting to the top of the list) – optimally, we would like for the components to be reconciled the same way as in React.
My suggestion is to therefore use key
from the element rowRenderer
returns as the underlying key and use the surrogate key only if the key
prop is not defined there.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Virtual scrolling: Core principles and basic implementation in ...
The virtual scrolling technique can be frustrating, but ultimately fun and rewarding to develop. Learn how to implement virtual scrolling in ...
Read more >ion-virtual-scroll - Ionic Framework
Virtual Scroll displays a virtual, "infinite" list. An array of records is passed to the virtual scroll containing the data to create templates...
Read more >how to unlock function key on dell laptop
On modern Dell laptops, you need to disable the Fn lock key by clicking ... Ctrl + O key to open the virtual...
Read more >Copying Slack's Brilliant Virtual Scrollbar And Overflow ...
The key to making all of this work is the fact that the overflow container is wider than the viewport. This renders the...
Read more >Zwift power.com - - Convittiadi Campobasso
Zwiftpower Login will sometimes glitch and take you a long time to try ... Due to virtual doping, most official ZwiftPower results require...
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’m afraid I don’t understand this issue.
Grid assigns a row key based on the item index. That’s the only safe way I’ve thought of to do things, given that react-virtualized supports dynamic row heights and therefore may have a varying number of rows visible at any time (making a key pooling/recycling approach difficult).
As of version 8, Grid defers the assignment to the rowRenderer anyway, although it passes a suggested key.
Woo hoo! That’s great. 😁
I was getting confused 😅
You’re welcome. Thanks for the kind words.