akiran / akiran/react-slick

ondemand lazy loading sometimes fails to load some images

Offen
#1,323 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
11.9k
Forks
2.1k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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](https://codesandbox.io/s/z2yzy90xzx), 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](https://user-images.githubusercontent.com/83964/43361543-0b459d6e-9286-11e8-981a-0aa7dd81974a.png)

### Note
FWIW, the template for submitting an issue suggests [a sandbox with broken CSS](https://codesandbox.io/s/ppwkk5l6xx) - 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](https://codesandbox.io/s/y0w9kqyq11), or you can add it in `index.css` using `@import`.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.