react-photo-gallery
react-photo-gallery copied to clipboard
Suppress Gallery layout trigger when parent element is hidden (width=0)
This PR avoids a re-layout of the photos when width is 0, ie. when the containing element is hidden.
Layout during width=0 causes the following problems:
- For an app with tabs, the scroll position of the gallery is not maintained when changing tabs.
- 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
Fixes #185