sveltejs / svelte-virtual-list

A virtual list component for Svelte apps
https://svelte.dev/repl/f78ddd84a1a540a9a40512df39ef751b
Other
688 stars 58 forks source link

Unique identifier stability problem when changing the list. #51

Open FunMiles opened 3 years ago

FunMiles commented 3 years ago

This virtual list is a remarkably concise code for what it does. Thanks, RIch.

I started using it in a test app in which I am showing database content. I hit a little problem when my data is altered (from a push from another editor) and the update gives a rather strange result. I think it is rooted in the few lines of code in the {#each visible as row (row.index)} block. The id for each item is simply the row.index. The example has a key variable to the data. Could it, or another data (id ?) in the array serve as a unique id for each object's rendering ?

gitbreaker222 commented 3 years ago

looks like the virtual-list doesn't get that much attention right now. Have you been able to fix the strange result? Otherwise it would be nice to have a little repl, so others can get a look on that issue :slightly_smiling_face: