-
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
Fix issue with margin collapsing when selecting blocks #50215
Merged
Merged
Conversation
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
jasmussen
added
[Type] Bug
An existing feature does not function as intended
[Feature] Block Multi Selection
The ability to select and manipulate multiple blocks
[Type] Regression
Related to a regression in the latest release
labels
May 1, 2023
Size Change: -13 B (0%) Total Size: 1.37 MB
ℹ️ View Unchanged
|
Flaky tests detected in 0337128. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4850505581
|
Looks much better, thanks |
mtias
approved these changes
May 1, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Feature] Block Multi Selection
The ability to select and manipulate multiple blocks
[Type] Bug
An existing feature does not function as intended
[Type] Regression
Related to a regression in the latest release
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.
What?
Followup to #44708. That PR added a border radius to the selection style, as well as an
overflow: hidden;
, the net result being that if you multi-select an image, a rounded radius is applied to every block inside, unless that block has its own radius.Unfortunately, that overflow property caused an issue with selecting a blockquote (and very probably other blocks that feature intrinsic margins, and paragraphs inside). Shown in this GIF, the quote appears to gain top and bottom padding, when multi selected:
Turns out that this is due to margin collapsing. The quote itself has one margin, the paragraph inside has another. When overflow is applied onselect, the margins stop collapsing, and the quote appears to grow due to the paragraph margins:
This PR removes the overflow property, fixing the issue:
It does have the side-effect, that when you select an image block, its corners no longer get "cropped off".
Testing Instructions
Test a quote with a couple of paragraphs inside. Select several blocks, including the quote. The quote should not change size when selected.