-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Catalog image lazy load #27033
Catalog image lazy load #27033
Conversation
Hi @tdgroot. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
<?= $escaper->escapeHtmlAttr($block->getCustomAttributes()) ?> | ||
src="<?= $escaper->escapeUrl($block->getImageUrl()) ?>" | ||
loading="lazy" | ||
width="<?= $escaper->escapeHtmlAttr($block->getWidth()) ?>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain why you changed max-width and max-height to just width and height? It looks not related to this PR.
As max width and max height are not valid attributes - seems like we could just remove them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The width and height attributes are needed to preserve the aspect ratio of the image when it is not loaded yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, no problem, but need just test it carefully on different devices, because it could do regression
app/code/Magento/Catalog/view/frontend/templates/product/image.phtml
Outdated
Show resolved
Hide resolved
app/code/Magento/Catalog/view/frontend/templates/product/image_with_borders.phtml
Outdated
Show resolved
Hide resolved
@magento run Functional Tests B2B |
Hi @ihor-sviziev, thank you for the review. |
✔️ QA Passed |
Hi @tdgroot, thank you for your contribution! |
Description (*)
This changeset adds lazy loading to the catalog product list.
Fixed Issues (if relevant)
Manual testing scenarios (*)
Related pull requests
Questions or comments
I think discussions on the topic 'image lazy loading' should be held on #27032.
Any code reviewing comments can be placed in this PR.
Contribution checklist (*)