-
Notifications
You must be signed in to change notification settings - Fork 10.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
[gatsby-image] Support image loading with JavaScript disabled #3109
Comments
There's no way afaik to tell the browser to delay loading an image unless we don't render the img element in the HTML. I'm not sure any image lazy loading technique works with JavaScript disabled. |
I think that the |
Ahhhhhh!!!! Yes! Of course! Could you put together a PR adding this? |
I’ll try my best to do so as soon as I’ll have some free time 😊 |
Would this be achieved by something like adding _react2.default.createElement("noscript", {},
_react2.default.createElement("img", {
alt: alt,
title: title,
src: image.src,
})
), to the index.js of gatsby-image? edit: after some tinkering I've discoverd it's not quite that easy. When I add this to the creation of a |
I have already created a pull request which solves the issue (tested on the latest version of Firefox). |
👌 that's awesome, thanks! Does it also prevent the base64 or tracedsvg image from showing up? |
@aderaaij With Firefox, the base64 / traced SVG image is shown until the original gets loaded. |
I think that by default, images'
src
,srcSet
and other attributes should be set to the final displayable image instead of e.g. an image with a width of 20 pixels.If JS is enabled, change to the preview image immediately until the final image is available.
The text was updated successfully, but these errors were encountered: