Full screen Icon repeated
feguensp opened this issue · 4 comments
Do you have an URL for demonstration? What do you mean with "Every time a new picture is selected to launch photoswipe"?
I don't understand the problem and can not reproduce it. See my working example here: https://arnowelzel.de/samples/photoswipe5/
And furthermore the use as part of my WordPress plugin: https://wordpress-demo.arnowelzel.de/lightbox-with-photoswipe-5-overlay-caption/
Edit: ok, got it - when building PhotoSwipe using the selector initialization, it seems that the plugin is called multiple times and not only once.
However - this looks like a bug in PhotoSwipe as it works fine with the WordPress integration where not PhotoSwipe is responsible to build the image collection but another frontend script.
I added a workaround to only add the UI element if it is not added already. It seems, Photoswipe calls init
and uiRegister
multiple times after it was opened once.
Closed with 3a5c153