Closed alanpoulain closed 4 years ago
In Firefox, when clicking on an image with a srcset attribute and a loading attribute set to lazy, the overlay loads but the image stays the same.
srcset
loading
lazy
The overlay cannot be closed because the isAnimating variable is true.
isAnimating
true
It's because of these lines: https://github.com/francoischalifour/medium-zoom/blob/d5f45c58a219e5dcbc546d8ba2fbfc883ec6df3e/src/medium-zoom.js#L378-L385
Removing the sizes attribute does fire the load event in Chrome, but not in Firefox.
sizes
load
Link to the bug reproduction
medium-zoom
I've opened a PR to fix this issue. Please also note this is the default configuration for gatsby-remark-images.
gatsby-remark-images
Bug description
In Firefox, when clicking on an image with a
srcset
attribute and aloading
attribute set tolazy
, the overlay loads but the image stays the same.The overlay cannot be closed because the
isAnimating
variable istrue
.It's because of these lines: https://github.com/francoischalifour/medium-zoom/blob/d5f45c58a219e5dcbc546d8ba2fbfc883ec6df3e/src/medium-zoom.js#L378-L385
Removing the
sizes
attribute does fire theload
event in Chrome, but not in Firefox.Reproducible example
Link to the bug reproduction
Environment
medium-zoom
version: 1.0.5