metafizzy / metafizzy/flickity

data-flickity-lazyload-srcset without data-flickity-lazyload-src

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

Description

If I prefer to set the srcset only by lazyLoad, the src attribute is set to null. Old browsers without srcset support will then not display the image. I must always set the data-flickity-lazyload-src attribute.

**Test case:** https://codepen.io/kajman-cz/pen/bGpwyEw

Looks like you just have to adjust
```
// set src & serset
this.img.src = src;
```
to
```
// set src & srcset
if ( src ) {
this.img.src = src;
}
```

Contributor guide

Open the contributing guide

Research direction

Start with the lazy-load image code containing the shown src and srcset assignment, then reproduce the behavior using the linked CodePen test case. Done means lazy-loading with only data-flickity-lazyload-srcset no longer assigns a null src, while the existing src behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.