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.

[DynamicSizeList] Wrong positions after adding/removing items from the list

See original GitHub issue

I’m experimenting with the branch #102.

Almost everything works well.

I’m facing a problem when the list items change:

  1. Render list with initial items (ok)
  2. Remove the second item
  3. See some items get positioned wrong

See the blank space between items after filtering out the item that contains the word “progress”:

Kapture 2019-07-11 at 21 59 27

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:

image

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:open
  • Created 4 years ago
  • Reactions:3
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
graphee-gabrielcommented, Jul 13, 2019

@nihgwu resetAfterIndex does not exist for DynamicSizeList https://react-window-next.now.sh/#/api/DynamicSizeList

2reactions
ttamminencommented, Aug 23, 2019

Just 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.

Read more comments on GitHub >

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

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