You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using webp picture solution as presented here : https://photoswipe.com/custom-content/#using-webp-image-format
You can observe closing photoswipe triggers the loading of jpg image, eg : open the first mountain image, then watch network in dev tools while closing photoswipe, you will see that the jpg version of the image is requested on closing
I managed to resolve the problem my modifying remove() functions in both photoswipe-lightbox.esm.js and photoswipe.esm.js adding this : if (this.element && this.element.parentNode && !this.pictureElement) { this.element.remove(); } if (this.pictureElement && this.pictureElement.parentNode) { this.pictureElement.remove(); }
in both functions
But this is not the cleanest way to do it I suppose, I know the "real" picture feature is being developed, but until then if some people want to use my dirty fix here it is
The text was updated successfully, but these errors were encountered:
Saving the pictureElement in the contentElement as mentioned by @michaelkhabarov doesn't solves the problem in our project. The destroy/remove action still loads the jpeg version.
Is there any known solution?
UPDATE
Turns out I need to update the contentElement both on destroy and on contentRemove.
When using webp picture solution as presented here : https://photoswipe.com/custom-content/#using-webp-image-format
You can observe closing photoswipe triggers the loading of jpg image, eg : open the first mountain image, then watch network in dev tools while closing photoswipe, you will see that the jpg version of the image is requested on closing
I managed to resolve the problem my modifying remove() functions in both photoswipe-lightbox.esm.js and photoswipe.esm.js adding this :
if (this.element && this.element.parentNode && !this.pictureElement) { this.element.remove(); } if (this.pictureElement && this.pictureElement.parentNode) { this.pictureElement.remove(); }
in both functions
But this is not the cleanest way to do it I suppose, I know the "real" picture feature is being developed, but until then if some people want to use my dirty fix here it is
The text was updated successfully, but these errors were encountered: