-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Image block: Lightbox animation improvements #51721
Merged
Merged
Commits on Jun 23, 2023
-
Add logic to use low-res image while high-res one is loading
We need to have two <img> elements in the DOM inside the lightbox because otherwise the image flickers when we change the src. I removed the src and srcset attributes from the responsive image when the larger one is loaded to signal that the low-res one is no longer in use.
Configuration menu - View commit details
-
Copy full SHA for 1026f82 - Browse repository at this point
Copy the full SHA 1026f82View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8b4ae20 - Browse repository at this point
Copy the full SHA 8b4ae20View commit details -
Configuration menu - View commit details
-
Copy full SHA for 135105c - Browse repository at this point
Copy the full SHA 135105cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 54047cb - Browse repository at this point
Copy the full SHA 54047cbView commit details -
Prevent responsive images from being loaded unnecessarily
The src attribute on the img elements was causing the srcset attribute to be added as well before the Interactivity API could remove them, causing images to be loaded before they were needed and in the wrong size. This commit removes the src attribute from the img elements before they are output to the DOM, and also updates the tests.
Configuration menu - View commit details
-
Copy full SHA for b4a3c1d - Browse repository at this point
Copy the full SHA b4a3c1dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 549e795 - Browse repository at this point
Copy the full SHA 549e795View commit details -
Configuration menu - View commit details
-
Copy full SHA for c0baefa - Browse repository at this point
Copy the full SHA c0baefaView commit details -
Configuration menu - View commit details
-
Copy full SHA for e713211 - Browse repository at this point
Copy the full SHA e713211View commit details -
Resolve image flash when opening lightbox
Rather than allowing the browser to pick the lightbox's responsive image, we now explicitly read the currentSrc attribute from the reference image and also prevent users from opening the lightbox until the reference image is fully loaded. Doing this, we can ensure the zoom animation plays smoothly and there are no oddities in the UX.
Configuration menu - View commit details
-
Copy full SHA for 7d3b3b5 - Browse repository at this point
Copy the full SHA 7d3b3b5View commit details
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.