Lightbox: Fix close button position.#56125
Conversation
|
Flaky tests detected in 4325568. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6867731391
|
|
gutenberg/packages/block-library/src/image/style.scss Lines 375 to 392 in a1ccf42 The 50vw here should also be 50%. |
|
Size Change: -582 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
t-hamano
left a comment
There was a problem hiding this comment.
Thanks for the PR! The approach seems to make sense to me too, but I'll leave a comment regarding one edge case.
michalczaplinski
left a comment
There was a problem hiding this comment.
Thanks for the PR! This approach seems sound to me! 👍
t-hamano
left a comment
There was a problem hiding this comment.
LGTM!
- ✅ When the document has the scrollbar
- ✅ When the document has the scrollbar and the body element has a fixed width
- ✅ When the document has no scrollbar
- ✅ When the document has no scrollbar and the body element has a fixed width
What?
Changed the position of close button to be calculated from the inside of the scroll bar.
Why?
Fix #56052.
This problem is more noticeable in Chrome on Windows because of the wider scrollbars, but the same problem occurs when the scrollbars are displayed on a Mac.
How?
Change width of
.wp-lightbox-overlayto100%.Because
.wp-lightbox-overlayis a child element ofbody, 100% is the size of 100vw minus the width of the scrollbar.Within
keyframes100%is not computed. Instead100vw - $scrollbar-widthis used.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast