PhotoSwipe icon indicating copy to clipboard operation
PhotoSwipe copied to clipboard

pswp--open keeps opened (not visible) but I cannot click on the screen after closing

Open juancresc opened this issue 5 years ago • 5 comments

If I reload my site and create a new gallery, when opening an image, the pswp--open div remains opened and I cannot interact with the page anymore. I noticed that if I inspected the element and remove the dislpay:block style from the element it works again, what could be the issue?

http://134.209.196.106/photos/animal/african-buffalo

.pswp--open { display: block; }

juancresc avatar Oct 11 '19 13:10 juancresc

I am also experiencing this recently. It seems the .pswp--open class is not being removed from the .pswp container... But only in these browsers:

  • Chrome 77.0.3865.120 (Windows)
  • Firefox 69.0.3 (Windows)

Photoswipe v4.1.3 is still working as intended for me in these browsers...

  • Edge 44.18362.387.0 (Windows)
  • Firefox 69.0.2 (Linux)
  • Firefox 68.1.1 (Android)
  • Chrome 77.0.3865.116 (Android)
  • Chromium 76.0.3809.100 (Linux)

I have implemented my galleries using the pattern outlined here...

Sorry I am unable to test iOS or Mac OS browsers. Hopefully this gives some insight to a possible fix.

drvid avatar Oct 21 '19 20:10 drvid

So, I'm glad to say this turned out to be an implementation error on my part. I had an extra .gallery wrapper around the .gallery element I was initializing from DOM. So after removing this, PhotoSwipe worked as expected. Thanks for the great library by the way.

drvid avatar Oct 28 '19 18:10 drvid

I have same problem, what happen?

longshihui avatar Nov 16 '20 06:11 longshihui

@longshihui I just had the same issue. Like @drvid mentions, you probably have two .pswp elements in the DOM?

jessedobbelaere avatar Jan 14 '21 20:01 jessedobbelaere

I had the same and then it turned out that I initialise lightbox twice. I removed the latter, and fixed. FYI. I think there is no need to keep this issue open.

muratcorlu avatar Apr 01 '24 12:04 muratcorlu