data-zoom-src not working with loading attribute
See original GitHub issueBug description
When zooming into an image that has a data-zoom-src
and a loading="lazy"
attribute, the webpage becomes unresponsive and stuck.
How to reproduce
This is easily reproducible if you have caching turned off (open dev tools and enable the “disable cache” option). It should also happen all the time if the browser has not cached/downloaded the data-zoom-src
image before
- Click on a image that contains a
data-zoom-src
and aloading="lazy"
attribute with adata-zoom-src
image that has not been cached yet
Here is a gif of what happens in action (the webpage becomes stuck and needs to be refreshed):
Reproducible example
Environment
- Browser: chrome / version: 99.0.4844.51
- Browser: firefox / version: 98.0.1 (64-bit)
medium-zoom
version: 1.0.6
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Why doesn't adding loading="lazy" with JavaScript work to ...
I'm able to add the loading="lazy" attribute on individual images, or with JavaScript and apply them all at once.
Read more >Lazy loading via attribute for images & iframes - CanIUse
The loading attribute on images & iframes gives authors control over when the browser should start loading the resource. Usage % of.
Read more >Browser-level image lazy loading for the web - web.dev
How does the loading attribute work with images that are in the viewport but not immediately visible (for example: behind a carousel, or...
Read more >Lazy loading - Web performance | MDN
Lazy loading is a strategy to identify resources as non-blocking (non-critical) and load these only when needed. It's a way to shorten the ......
Read more >WebP Picture conflict with Lazy Loading - WordPress.org
We use WP filter wp_get_attachment_image_attributes to add lazy loading attributes to our images and it is working fine. We remove srcset and sizes...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s up to @francoischalifour to create an official release, I’m just a random dude who submitted a pull request. I guess you could fork this repo and submit your own package in npm with the fix included.
🎉 This fix was released in v1.0.7.
Sorry that it took this long to release. I got local dependency issues on my new laptop which put off the release. I should invest in triggering the release from the CI.