react-virtualized
react-virtualized copied to clipboard
re-rendering list
hi, I am using virtualized with react-sortable-hoc. I have used Masonry component to display data. but when i drag and drop elements, data is re-rendering and scroll going on the top. how do i maintain scroll even if data is re-rendered? is there any way to set startIndex? also scroll to position is not available in Masonry.
Hi! Any progress on this issue?
Hi, See this example - https://codesandbox.io/s/ovz73vwn26 When i move 1st item to the last item, scroll does not maintain its position, it goes on top. how to fix this issue?
Hi @VikrantShirvankar, the issue here is recreating cache, cellPositioner and entire Masonry on each rerender, which causes complete Masonry to be rerendered and therefore scroll is set to initial top position. Just move those functions out of the render method in Child component. Working example: https://codesandbox.io/s/virtualized-sortable-450ii Hope this helps.
Hi @neemanjabu, Great! Thanks.
I also encountered this issue, but the example at https://codesandbox.io/s/virtualized-sortable-450ii can't be accessed anymore. Could you please repost the solution?
We are having the same issue. Does anyone have the solution?