Lazy loading multiple images from random points of the array?
See original GitHub issueI have noticed that when I click the arrows for the next/prev slide there are multiple images loading in. I have tried to make sense of it because I am sure that there is a reason for it.
Currently on first click I have the next slide loading (which I would expect) then 2 images from the end of the images array. Then on the 2nd click I have the same but 2 images from the start and end of the array, then the next click (3rd) its also getting 2 images for the slide 2 previous to the current slide. Then that happens going forward.
I hope this makes sense? I have included some screen shots to maybe help you to better understand this issue.
First click
Second click
Third click
I am passing the following props to ImageGallery:
<ImageGallery
items={imageArray2}
lazyLoad
renderLeftNav={this.renderLeftNav}
renderRightNav={this.renderRightNav}
showIndex={imageArray2.length > 1}
onSlide={this.fadeIn}
/>
The array is structured as follows:
original: slide.entity.fieldImage.entity.fieldMediaImage.large.url,
originalAlt: slide.entity.fieldImage.entity.fieldMediaImage.alt,
originalTitle: slide.entity.fieldCaption,
description: slide.entity.fieldCaption,
thumbnail: slide.entity.fieldImage.entity.fieldMediaImage.thumb.url,
thumbnailAlt: slide.entity.fieldImage.entity.fieldMediaImage.alt,
thumbnailTitle: slide.entity.fieldCaption,
imageSet: [
{
srcSet: slide.entity.fieldImage.entity.fieldMediaImage.small.url,
media: '(max-width: 576px)',
},
{
srcSet: slide.entity.fieldImage.entity.fieldMediaImage.medium.url,
media: '(min-width: 768px)',
},
{
srcSet: slide.entity.fieldImage.entity.fieldMediaImage.large.url,
media: '(min-width: 1280px)',
},
],
I hope this is enough to go on for the moment. If you would like anything else or anymore info please let me know.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:16 (6 by maintainers)
Top GitHub Comments
Same issue here: same pictures are downloaded repeatedly and continuously.
Yes, same issue, please fix this …