aeharding / voyager

Voyager — a mobile-first Lemmy client
https://vger.app
GNU Affero General Public License v3.0
1.48k stars 166 forks source link

Gallery closes on auto screen rotate #304

Closed tranzystorekk closed 1 year ago

tranzystorekk commented 1 year ago

When turning screen on Android in gallery mode, instead of rotating the image the gallery component instead closes and wefwef displays auto-rotated feed

Update: this happens only when rotating from vertical to horizontal, not the other way around.

aeharding commented 1 year ago

This is due to virtuoso remounting grid items on rotation.

That causes photoswipe to close.

It looks like to solve this we're going to need to move photoswipe outside of the infinite grid. We may also need to use photoswipe directly instead of react-photoswipe.

Luckily infinite scroll case is specifically accounted for in photoswipe library :) https://photoswipe.com/data-sources#separate-dom-and-data

Assigning myself