Lazy load images not replaced correctly

Created on 4 January 2024, over 1 year ago

When using the lazy loading setting and depending on how the CSS is used for the layout of the element on the page the wrong image size can be selected by resizer.js. If also get a flash of the "no image" icon as the image is replaced.

I have attached a video of this issue to the ticket to demonstrate

🐛 Bug report
Status

Active

Version

1.3

Component

Code

Created by

🇨🇦Canada paulsheldrake

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @paulsheldrake
  • 🇳🇱Netherlands seanB Netherlands

    I would generally advise adding width: 100% to responsive images in CSS. I think that should solve the issue. It seems that in this case the parent of the image does not have a width when the image is empty, while the image is looking at the width of the parent to determine the correct source.

    Regarding the "flash", we unset the src for lazy loaded images to prevent them from being loaded by the browser. It prevents duplicate images being loaded in some cases. However, if an image is in the viewport, removing the source can cause this flash. I think we might be able to figure something out to solve this.

  • 🇧🇪Belgium dieterholvoet Brussels

    I created a separate issue for the broken image flash problem: 🐛 Flash of missing image when lazy loading Active .

  • Status changed to Closed: won't fix 18 days ago
  • 🇳🇱Netherlands seanB Netherlands

    Since we have 🐛 Flash of missing image when lazy loading Active to handle the flash, and the image size needs to be done using CSS, I think this is a won't fix issue.

Production build 0.71.5 2024