fix(gatsby-image): use the cache to tell if the image was already loaded#11303
Merged
pieh merged 1 commit intogatsbyjs:masterfrom Jan 28, 2019
carlrosell:fix-gatsby-image
Merged
fix(gatsby-image): use the cache to tell if the image was already loaded#11303pieh merged 1 commit intogatsbyjs:masterfrom carlrosell:fix-gatsby-image
pieh merged 1 commit intogatsbyjs:masterfrom
carlrosell:fix-gatsby-image
Conversation
The order of the IntersectionObserver and the image load event is not deterministic. By using the image cache to tell if the image was loaded or not, the call order will no longer be an issue.
Contributor
Author
|
This issue might be related #11298 |
|
@carlrosell thanks for referencing to my issue. I cloned your project and tested it by replacing the gatsby-image index file and it fixed my problem. Before: |
pieh
approved these changes
Jan 28, 2019
Contributor
pieh
left a comment
There was a problem hiding this comment.
It makes sense. Thanks @carlrosell!
jlengstorf
pushed a commit
to gatsbyjs/store.gatsbyjs.org
that referenced
this pull request
Feb 8, 2019
I found an issue with gatsby-image on the store site, I created this PR gatsbyjs/gatsby#11303, so the issue has been fixed in the latest version. close #211
raffishquartan
pushed a commit
to raffishquartan/gatsby
that referenced
this pull request
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
I found a weird issue while browsing the gatsby store earlier today. When I reloaded the product detail page the images were not loaded correctly.
It turns out that the order of the IntersectionObserver and the image load event is not deterministic. By using the image cache to tell if the image was loaded or not, the call order will no longer be an issue.
Before:
After:
Related Issues
Fixes: #11298