jaredLunde/masonic

Rendered list items are reloaded sometimes when scrolling or resizing the window

mmmulani opened this issue · 3 comments

Describe the bug
When using an iframe, video, or any web component with implicit state, scrolling or resizing the window (to cause the column count to change) can sometimes cause a complete re-render of a list item causing all the state to be lost.

Example using the default codebox with the first element changed into an iframe of Wikipedia:
https://codesandbox.io/s/masonic-example-forked-52xrvi?file=/src/index.js

Resizing the window such that the column count changes will cause the iframe to be completely reloaded, even though it is within the viewport the whole time.

I looked through the masonic code and it seems to be using key effectively which should prevent this issue but it's still happening. I also found this somewhat relevant issue: whatwg/html#5484 though that seems to be about reparenting which should not be happening in this case.

Desktop (please complete the following information):
MacOS 12.3, Chrome v100, though we have been using Masonic for over a year and seen this issue.

Yes, even the images reload on the sandbox.

Having the same issue. @jaredLunde is there an explanation here? Thanks!

not sure how unexpected this is. might happen with any windowing library :\