react-slick icon indicating copy to clipboard operation
react-slick copied to clipboard

ondemand lazy loading sometimes fails to load some images

Open redbmk opened this issue 7 years ago • 5 comments

If you are using ondemand lazy loading and the number of slides doesn't divide evenly into your slidesToShow/slidesToScroll, then skipping directly to the last page will make it so some of the images end up not rendering.

In this example, I'm using 7 images, showing 3 images at a time and sliding 3 images at a time. That means that page 3 should have the 5th, 6th, and 7th image. If you scroll one page at a time, that's what you'll get. However, if you skip directly to the last page, you'll see two blank spots before the 7th image, like in this picture:

missing two images

Note

FWIW, the template for submitting an issue suggests a sandbox with broken CSS - it looks like you can't add separate head and body tags, but you can still add the css via HTML, like in this sandbox, or you can add it in index.css using @import.

redbmk avatar Jul 28 '18 23:07 redbmk

Same here, I think a simple fix is to trigger second last page rendering whenever we visit the last page.

chuyik avatar Sep 28 '18 09:09 chuyik

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 23 '19 10:09 stale[bot]

Maybe I can take a look at this next week. Hopefully it's a simple fix

redbmk avatar Sep 23 '19 16:09 redbmk

image oh no, i still have the same error, please help me

phu1710 avatar Oct 29 '21 08:10 phu1710

@phu1710 would you mind taking a look at #1661 to see if that helps? Looks like it was over 2 years ago when I made the PR, so it's been a while since I used it, but it doesn't look like that logic has changed since then, so it should still be relevant. I just updated with the latest code and fixed the merge conflicts.

redbmk avatar Dec 01 '21 08:12 redbmk