-
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
Grid Visualizer: Fix resize not ending when mouse is released outside grid's bounds #61668
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. |
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.
LGTM!
Size Change: -31 B (0%) Total Size: 1.75 MB
ℹ️ View Unchanged
|
What?
Fixes an outstanding bug related to #61633. In trunk if you start resizing a grid item and let go of the mouse when the mouse it outside of the grid block, the resize action doesn't end.
How?
The problem is twofold:
event.target.ownerDocument
which is the editor's document. We actually want to be targeting the editoriframe
's document because themouseup
event doesn't leave the iframe when the user releases the mouse over an element in the iframe.AbortController
before we add an event listener that uses it which means that it never fires. We can useonce: true
instead which is much simpler.Testing Instructions