metafizzy / metafizzy/flickity

lazyLoad loading too many images

Open
#1,245 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
7.6k
Forks
593
PR merge metrics
No merged PRs in 30d

Description

The issue originates from RR https://github.com/metafizzy/flickity/pull/158

While this is more than 7 years ago, this change actually leads to weird behaviour in the following scenario:

Settings: `100% slide width, lazyLoad: 1 and wrapAround: false`
Slide Amount: 3

I would expect to always only lazyload the next element in this case, however with that change in the PR it leads to preloading all images if there are 3 slides total since `1 + (1 * 2) >= 3`.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the lazyLoad behavior introduced in pull request #158 and reproduce the reported setup: three slides, 100% slide width, lazyLoad: 1, and wrapAround: false. Trace why all three images preload; done means only the next element is lazy-loaded in this scenario without breaking other lazy-loading behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.