[DynamicSizeList] Wrong positions after adding/removing items from the list
See original GitHub issueI’m experimenting with the branch #102.
Almost everything works well.
I’m facing a problem when the list items change:
- Render list with initial items (ok)
- Remove the second item
- See some items get positioned wrong
See the blank space between items after filtering out the item that contains the word “progress”:
After I scroll past this blank space and go back, it get’s fixed.
I also noticed the items get wrong positions if new items are added to the list.
See wrong spacing after first item and cut off bottom buttons of the second item:
I don’t have a small reproducible demo, but the gif above is from this branch
I check and confirmed the props being passed to DynamicSizeList
are being updated correctly (itemCount
changes and this.getItemKey(2)
get the the new id), so I believe it’s some react-window internal, probably related to the cache.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:10 (1 by maintainers)
Top Results From Across the Web
React list rendering wrong data after deleting item
It's because you're using key={index} instead of a value unique to the student. When the array is modified the students after the index ......
Read more >Latest performance tips - Unity Forum
Direct Access with a dynamic size: List ... In general you should do "performance" stuff last, after you've profiled.
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
@nihgwu
resetAfterIndex
does not exist forDynamicSizeList
https://react-window-next.now.sh/#/api/DynamicSizeListJust wanted to inform that I have the same issue.
In my case, the dimensions of a list item change due to the filtering. I think the
itemSize
calculation should re-triggered somehow.