-
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] Base64 version of image isn't hidden on first page load #9264
Comments
Possibly related: #8323 |
After digging around in the code, I think the problem lies in the caching system. It only occurs when an image is used twice on the page. The check (index.js, L126-138) only sets IOSupported to true if the image hasn't been seen before, which might cause problems. However, I don't know if that is the root of this bug. |
The issue could also be fixed by #7539. |
Would you be able to test locally if #7539 fixes it for you? If you're adventurous you could also try this very unofficial drop-in replacement. |
It's hard to merge #7539 with the current codebase as the current code base has changed in the meantime. However, I'll try out your drop-in replacement. That looks promising 👍 |
Have you managed to solve the issue? |
Finishing the project was a higher priority the last few days, so we used the workaround, but I'll see if I can try out your drop-in replacement tomorrow. |
This should be fixed in |
Description
I'm using gatsby-image to lazy-load some png images. Normally, after the image is loaded, the small base64 version is hidden. However, this doesn't happen when I load the built site. This leads to both images being visible at the same time which looks weird.
Upon inspecting the component, I see that
imgLoaded
is correctly set totrue
, but that doesn't seem to affect the base64 version's opacity.Please find attached a screenshot of the bug:
I've circumvented the issue temporarily by giving the high-resolution image a colored background so the base64 version isn't visible anymore.
Steps to reproduce
You can reproduce the issue on this page (I used Chrome to test this).
This issue only occurs when the page is initially loaded. When I navigate to this page from another page, everything works as expected.
Expected result
The base64 version should not be visible after the high-resolution version finished loading.
Actual result
The base64 version is still visible.
Environment
The text was updated successfully, but these errors were encountered: