Fix extraneous scrollbar in device previews#66494
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: -20 B (0%) Total Size: 1.81 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 3fce8eb. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11528084507
|
|
Thanks for testing and reviewing Aki! |
Co-authored-by: stokesman <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: colorful-tones <[email protected]> Co-authored-by: dhruvang21 <[email protected]>
|
I just cherry-picked this PR to the wp/6.7 branch to get it included in the next release: 88c51c7 |
Co-authored-by: stokesman <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: colorful-tones <[email protected]> Co-authored-by: dhruvang21 <[email protected]>


What?
A style revision to fix #66156
Why?
We don’t need a third scrolling area.
How?
Removes
overflow-x: hidden;fromIframe’s__containerelement. This prevents a BFC being formed becauseoverflow-yimplicitly becomesauto. That was causing the element to contain the vertical margins that are added to the iframe in device previews. Those margins plus the100%height of the child seems to be the what creates the overflow.More notes
Changing the
overflow-x: hiddentooverflow: hiddenalso seems to work but also seems unnecessary. Theoverflow-x: hiddenrule originated in #61424 and perhaps was necessary then yet now it seems to have no purpose.Testing Instructions
General tip: make sure your OS is set to always show scrollbars as it makes these types of issues easier to spot.
Device Previews and zoom out
No regression of #65977
1- Run storybook locally npm run storybook:dev
2- Open the playground box story
3- Notice that the height of the canvas is set to 500px, there's no extra border for the iframe and that the width of the canvas is 100%
Screenshots or screencast
fixed-device-preview-extra-scroll-area.mp4