-
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
Cover block: Remove overflow hidden rule #49913
Cover block: Remove overflow hidden rule #49913
Conversation
Size Change: -25 B (0%) Total Size: 1.37 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.
Thanks for the fix @andrewserong 👍
This tests as advertised for me.
✅ Works with a variety of cover blocks (image or color background, with or without borders, different content, duotone filters etc)
✅ No scrollbars or clipping occurs in either block or site editors
✅ Cover block displays fine on the front end
Before | After |
---|---|
Flaky tests detected in 731e3a5. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4740384154
|
Thanks for reviewing so quickly, much appreciated! |
@andrewserong @aaronrobertshaw removing cc @bph |
Thanks for flagging this @ndiego! I'll look into this further, but if we can't come up with a short-term fix to preserve the removal of I'm wondering if we can somehow get the background element to inherit border-radius, rather than relying upon |
I've opened a quick revert PR over in #50209 — I'd be happy with us going with that in the interim, as it doesn't look like inheriting border-radius will quite work, as the background element would need a different value from its parent in order to not have a gap between the borders. Or, we'd want to apply the border to the child instead of the outer wrapper, which could also cause other issues 🤔. Example pic of setting the child to inherit the border from the parent: For now, I think let's fix the regression, and we can look at other potential options in follow-ups. |
What?
Remove
overflow: hidden
rule from the Cover block's styling rules, and retainoverflow: visible
for theblock-library-cover__resize-container
so that the drag handle is still visible outside the edge of the block. This is a follow-up to some of the changes landed in #41153.Why?
While working on re-enabling sticky positioning at non-root positions over in #49321, I noticed that the
sticky: position
rule does not work when the parent hasoverflow: hidden
set. Because the Cover block is a prominent container block, before landing #49321, it would be good to ensure that all the main container blocks can technically support sticky children.As far as I can tell, we no longer need an
overflow: hidden
rule because the resizeable box is using a block popover. From testing, I think the only place we need an overflow rule is for the resize container so that the handle is visible. Alsooverflow: visible
hides any scrollbars within the popover.This PR seems to resolve a subtle issue on
trunk
where the drag handle is sometimes not visible, and there is sometimes a scrollbar within the resizeable box — I only ran into these issues in the site editor, not the post editor.How?
overflow: hidden
from the block's styling rulesoverflow: visible
from the placeholder state — sinceoverflow: hidden
has been removed, we should no longer need this additional ruleoverflow: visible
to the resize containerTesting Instructions
A question for the reviewer — have I missed anything that was depending on the existing rules?
Testing Instructions for Keyboard
Screenshots or screencast
The below screenshots are from within the site editor.