Image block: fix placement of resizable overlay#69381
Draft
stokesman wants to merge 1 commit into
Draft
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: +21 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
2 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?
Follow up to #68666.
Improves positioning of the resizable component in the Image block.
Why?
The resizable component is now overlaying the image instead of wrapping it. This means they could become misaligned. While some logic to maintain their alignment was included, it proves to be insufficient in at least the TT1 theme. Using
Popoverfixes that particular issue and probably other edge cases we’ve yet to encounter.How?
Leverages the
Popover’s comprehensive anchoring behavior to keep the resizable component overlaid on the image.Consideration of alternative implementation
The Cover block had this same thing done a while back #41153. It’s different in that its popover is based on
BlockPopoverinstead ofPopover. It would seem most suitable to reuse the same component here yet this use case has an important difference that is not supported by it—the anchor of the popover is a child of the root block element.I experimented with extending
BlockPopoverfor this use case and it can be done simply enough. However, it won’t much simplify the implementation in the Image block. I’m undecided on which approach I favor.Testing Instructions
Screenshots or screencast
Before with TT1
TT1-resizable-fail.mp4
After with TT1
TT1-resizable-success.mp4