react-photo-gallery icon indicating copy to clipboard operation
react-photo-gallery copied to clipboard

Suppress Gallery layout trigger when parent element is hidden (width=0)

Open cvolzke4 opened this issue 4 years ago • 1 comments

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:

  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

Fixes #185

cvolzke4 avatar Sep 01 '20 10:09 cvolzke4

Coverage Status

Coverage increased (+0.09%) to 86.644% when pulling 3962d693e4c22701708d53c87f9fd732e8f52bc3 on cvolzke4:fix-hidden-layout into 0bb8e4c4a027c021f8a5a06de71e89026596fd95 on neptunian:master.

coveralls avatar Sep 01 '20 10:09 coveralls