jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

Jetpack Carousel: Lightbox breaks with lazyload

Open codetipi opened this issue 5 years ago • 1 comments

Steps to reproduce the issue

  1. Go to https://www.insposa.co.uk/bridal-fashion/wedding-dresses/our-10-favourite-wedding-dresses-from-the-meadow-collection-by-katya-katya-london/
  2. Click on an image inside the gallery block slightly further down the page
  3. Lightbox won't work due to JavaScript error

What I expected

Lightbox to work

What happened instead

Lightbox breaks due to lazy load code changing the image HTML output to perform the lazy load. I'm imagining Jetpack adds the orig-size attribute too late or via JS.

Ultimately, trying to open the lightbox leads to this JavaScript error:

Uncaught TypeError: Cannot read property 'split' of undefined

This error happens at:

.data("orig-size").split(",")

There should be a check for that attribute first and a fallback to get the image width if it doesn't exist.

codetipi avatar Jun 05 '21 16:06 codetipi

Thanks for the report. This is something that may be addressed by this PR: #20010

If you get the chance, do not hesitate to give it a try, and let us know if that fixes the problem for you!

jeherve avatar Jun 07 '21 13:06 jeherve