neptunian / react-photo-gallery

React Photo Gallery
http://neptunian.github.io/react-photo-gallery/
Other
1.97k stars 310 forks source link

Gallery layout is triggered when parent element is hidden (width=0) #185

Open cvolzke4 opened 4 years ago

cvolzke4 commented 4 years ago

A re-layout of the photos happens when width is 0, ie. when the containing element is hidden. This causes the following problems:

  1. For an app with tabs, the scroll position of the gallery is not maintained when changing tabs.
  2. A complete re-layout is performed, which causes images to re-render causing flicker.

Screencast before: share.getcloudapp.com/2NuybPlb

Screencast with a fix: share.getcloudapp.com/6quebvrB

cvolzke4 commented 4 years ago

Feel free to ping me at cvolzke@google.com if you have any questions.

We'd like to use this in our Story Editor app.

PR: https://github.com/neptunian/react-photo-gallery/pull/184