-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Revise zoom layout shift fix #66390
Revise zoom layout shift fix #66390
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: +1 B (0%) Total Size: 1.81 MB
ℹ️ View Unchanged
|
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.
Overall this is testing great for me, and to me it feels like the right fix. The one issue I've encountered is that this winds up affecting the block previews in global styles, so they're no longer vertically aligned:
Trunk | This PR |
---|---|
I wonder if it's worth seeing if we can apply display: flow-root
only to the iframe used for the editor canvas, or something like that?
Otherwise it's testing well:
✅ Resolves the scrollbar issue
✅ Preserves the fix for the layout shift
✅ Working nicely for me in template preview and not template preview modes, in the post and site editors
Thanks again for digging in to try to find a more stable fix!
Thanks for getting this up 🍺 |
Thanks for the quick review and spotting that issue Andrew! I think to fix it we might incorporate both your ideas. I’d already thought reducing the specificity might be the right thing to do in general. Also, I almost decided to add the style in gutenberg/packages/editor/src/components/visual-editor/index.js Lines 355 to 366 in 67fca2e
You’re welcome to jump in and fix it. I can get to it early tomorrow but it’s EOD for me. |
Update: I wonder if it'd work to set this body rule here instead, so it's only on gutenberg/packages/editor/src/components/visual-editor/index.js Lines 348 to 359 in 6d8f1cf
I see there's also the same rule on the |
Snap! We had the same idea 😆 I'll try pushing a commit and let's see how we go! |
Alrighty, I've given that a try in f4eaee5 It seems to be testing pretty well for me. Feel free to update and/or revert that commit as needed, of course! |
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.
This is testing well for me, so I'm going to give it the ✅.
It might be worth getting a second opinion before landing since I've worked on this, too! 😅
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.
Thanks for the review! Since we'd like to get this in for 6.7 I'll merge this in. Thanks again for opening this @stokesman 🙇 |
* Contain margins with BFC instead of border * Move to block canvas styles in the visual editor --------- Co-authored-by: Andrew Serong <[email protected]> Co-authored-by: stokesman <[email protected]> Co-authored-by: andrewserong <[email protected]> Co-authored-by: ramonjd <[email protected]> Co-authored-by: t-hamano <[email protected]>
I just cherry-picked this PR to the wp/6.7 branch to get it included in the next release: 1e39ceb |
Yes, I’d been curious about that and found it was added with the Style Book a26d321 but there’s nothing there noting what it specifically dealt with and, curiously, doesn’t actually apply in the Style Book now. It does seem to be the thing saving templated views from potentially having the same layout shift issue as post-only views had. With some brief testing the rule on the body seemed to suffice for that on its own. Something to look at in a separate effort anyway. Thanks again folks ❤️ |
* Contain margins with BFC instead of border * Move to block canvas styles in the visual editor --------- Co-authored-by: Andrew Serong <[email protected]> Co-authored-by: stokesman <[email protected]> Co-authored-by: andrewserong <[email protected]> Co-authored-by: ramonjd <[email protected]> Co-authored-by: t-hamano <[email protected]>
* Contain margins with BFC instead of border * Move to block canvas styles in the visual editor --------- Co-authored-by: Andrew Serong <[email protected]> Co-authored-by: stokesman <[email protected]> Co-authored-by: andrewserong <[email protected]> Co-authored-by: ramonjd <[email protected]> Co-authored-by: t-hamano <[email protected]>
What?
A revised way to fix the layout shift that #66041 fixed and an alternative way to fix #66297.
Why?
The a
border
rule used in the prior PR caused #66297 and also introduces minute layout differences in unintended places. Here’s one @ramonjd spotted #66041 (comment)Kapture.2024-10-23.at.10.55.47.mp4
How?
Steals Ramon’s idea #66041 (comment) to use
display: flow-root
Testing Instructions
No layout shift (from #66041)
No vertical scrollbar in focused editor
There should be no vertical scrollbar.
Screenshots or screencast