-
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 drag and drop performance when dragging over the insertion point #42806
Conversation
Size Change: +85 B (0%) Total Size: 1.26 MB
ℹ️ View Unchanged
|
cb519e4
to
a8ede36
Compare
This makes a huge difference Beforebefore.mp4Afterafter.mp4Something I noticed was that I the drag is cancelled if I try to drag down over blocks that use the resizable component, e.g., Image and Cover blocks 2022-08-01.08.43.27.mp4 |
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 tested well for me - big improvement in performance.
@ramon looking at the screen capture I think that might be the first bug described here |
Ah, thanks! Then LGTM too. A vast improvement on the current experience. |
Thanks for the reviews! I've reported the other issue in #42840. |
What?
Fixes #42363
Solves a drag and drop performance issue when dragging over the insertion point.
Why?
The changes in #40441 were a little over-enthusiastic in removing
pointer-events: none
from the insertion point.For drag and drop,
pointer-events: none
is pretty important, it prevents the insertion point from intercepting drag events and lets the block drop zone receive them. Without it, the insertion point continuously toggles between being hidden and shown causing performance to degrade.How?
Adds
pointer-events: none
again.pointer-events: none
needs to be set from the root of the popover and that can only be done in block popover styles. However the block popover is a generic component now, so pointer events only need to be disabled when it's not an inbetween popover, hence the addedblock-editor-block-popover__inbetween
classname.Pointer events are enabled when the insertion point
is-with-inserter
—it has the '+' button that displays when hovering between blocks (and not dragging).Testing Instructions
Note that the first bug I described in #42363 (comment) is still present.
Screenshots or screencast
Kapture.2022-07-29.at.17.17.07.mp4