sitegeist/sms-responsive-images

Set height attribute on img-tag when using lazy loading

sir-gawain opened this issue · 0 comments

If i use <picture> tag with sources with "srcset" and "sizes", and enable lazy loading using the native loading="lazy" attribute, Chrome does not load the images on page load. Adding the height attribute to the image-tag solves the problem.

Add in line 239 of ResponsiveImagesUtility.php:
$fallbackTag->addAttribute('height', $fallbackImage->getProperty('height'));