Skip to content

Set height attribute on img-tag when using lazy loading #105

@sir-gawain

Description

@sir-gawain

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'));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions