question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VirtualScroll should honor row keys

See original GitHub issue

Right 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:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bvaughncommented, Sep 20, 2016

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.

0reactions
bvaughncommented, Sep 20, 2016

Woo hoo! That’s great. 😁

I was getting confused 😅

You’re welcome. Thanks for the kind words.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found