lightGallery icon indicating copy to clipboard operation
lightGallery copied to clipboard

Carousel gallery transition errors

Open trouba opened this issue 8 months ago • 1 comments

Description

Errors when interacting with the picture before it's loaded on the gallery carousel

Steps to reproduce

Can be reproduced on the demo page: https://www.lightgalleryjs.com/demos/carousel-gallery/

  • On the carousel gallery
  • When switching between two pictures
  • Click or touch the loading area (before the new pictures appears)
  • Multiple errors appear:
TypeError: undefined is not an object (evaluating '$image.getBoundingClientRect')
TypeError: undefined is not an object (evaluating '$image.get().getBoundingClientRect')
TypeError: undefined is not an object (evaluating '$image.get().offsetWidth')

It fires up a lot on mobile when switching through image if they are heavy and don't load quickly When using sentry, thousands of these errors appears in our logs

This is the same issue as this one https://github.com/sachinchoolur/lightGallery/issues/1485 but can easily be reproduced on the demos so I think it's worth investigating

trouba avatar Jun 19 '24 07:06 trouba