-
Notifications
You must be signed in to change notification settings - Fork 4.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
Image: Fix layout shift when lightbox is opened and closed #53026
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
3a43283
Replace overflow: hidden with JavaScript callback to prevent scrolling
artemiomorales c438e15
Disable scroll callback on mobile; add comments; fix scrim styles
artemiomorales 4168036
Add handling for horizontally oriented pages
artemiomorales 564db4c
Move close button so that it's further from scrollbar on desktop
artemiomorales 2f7af76
Fix call to handleScroll() and add touch callback to new render method
artemiomorales 2c94042
Improve lightbox experience on mobile
artemiomorales aa2b495
Fix spacing
artemiomorales 2e38ab0
Add touch directives to block supports
artemiomorales 59d32e8
Fix spacing in block supports
artemiomorales 057a164
Rename attribute for clarity
artemiomorales dc7a8b4
Update comment
artemiomorales 734096a
Update comments
artemiomorales 82eb2ba
Fix spacing
artemiomorales File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a practical way to cancel the animation upon scroll without causing the page to shift? sorry if someone has already asked about this; it seems like another approach to avoid jitter in the page without actively preventing someone from doing what they're trying to do. asking because it can be irritating on a website when you try to scroll but have to wait for a prolonged period for some animation to complete.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pardon, the comment here was out of date. The lightbox no longer closes on scroll; users needs to click on the overlay or close button to close it.
That being said, I was testing, and we could just get rid of the delay. It's less than half a second though, and if we did get rid of it, the lightbox in that case may look sloppy, especially to less technically inclined users.
While we could add robust handling and logic to optimize the UX for a canceled zoom animation, I'm not sure that would be worth the time invested. I feel it requires a lot of effort to close the lightbox then immediately scroll and beat the 450 millisecond delay, after which scroll input is recognized immediately anyway.
The robust handling could be added in the future, though I think that can be a separate PR.