Skip to content
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

Try: Show drag slot instead of hiding the item being dragged. #33950

Merged
merged 5 commits into from
Nov 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions packages/block-editor/src/components/block-draggable/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,23 @@
}
}

// This hides the block being dragged.
// The effect is that the block being dragged appears to be "lifted".
.is-dragging {
display: none !important;
// This creates a "slot" where the block you're dragging appeared.
// We use !important as one of the rules are meant to be overriden.
.block-editor-block-list__layout .is-dragging {
background-color: currentColor !important;
opacity: 0.05 !important;
border-radius: $radius-block-ui !important;

// Disabling pointer events during the drag event is necessary,
// lest the block might affect your drag operation.
pointer-events: none !important;

// Hide the multi selection indicator when dragging.
&::selection {
background: transparent !important;
}

&::after {
content: none !important;
}
}