DerYeger / yeger

Monorepo for @yeger/ NPM packages
MIT License
306 stars 23 forks source link

bug: When the window is resized and the column count changes, all images are reloaded #297

Closed dword-design closed 2 months ago

dword-design commented 2 months ago

Affected Packages

Description

When the window is resized and the column count changes, all images are reloaded. I think it would be good if the elements would still be there but rearranged. Otherwise the performance is poor on bigger resize events.

Reproduction

Create a wall with multiple images and multiple columns. Then resize the window so that the column count changes.

Additional context

No response

Preferences

DerYeger commented 2 months ago

This is not a bug, the slots are inherently stateless. You may either use a state-maintaining solution, e.g., stores, for your components, or ensure that a fresh mount won't result in UX issues, e.g., ensuring that the browser's built-in image caching is enabled.