Skip to content

Commit

Permalink
fix: update srcset logic to handle lazy vs non-lazy images + srcset /…
Browse files Browse the repository at this point in the history
… src / placeholder fallbacks depending on the mode the component is getting loaded
  • Loading branch information
sghoweri committed Oct 24, 2019
1 parent 170829f commit 35a9c8f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/components/bolt-image/src/image.js
Expand Up @@ -214,7 +214,11 @@ class BoltImage extends withLitHtml() {
src="${ifDefined(src ? src : fallbackSrc)}"
alt="${ifDefined(alt ? alt : undefined)}"
srcset="${ifDefined(
lazyload ? placeholderImage : srcset ? srcset : undefined,
!lazyload
? srcset || src || undefined
: this.isLazyLoaded
? srcset
: placeholderImage,
)}"
data-srcset="${ifDefined(lazyload ? srcset || src : undefined)}"
sizes="${ifDefined(
Expand Down

0 comments on commit 35a9c8f

Please sign in to comment.