Skip to content
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
14 changes: 6 additions & 8 deletions packages/core/src/extensions/SideMenu/SideMenuPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,21 +498,19 @@ export class SideMenuView<
}
const { isDropPoint, isDropWithinEditorBounds, isDragOrigin } = context;

if (!isDropWithinEditorBounds) {
if (!isDropWithinEditorBounds && isDropPoint) {
// Any time that the drop event is outside of the editor bounds (but still close to an editor instance)
// We dispatch a synthetic event that is in the bounds of the editor instance, to have the correct drop point
this.dispatchSyntheticEvent(event);
}

if (isDropPoint && isDragOrigin) {
// The current instance is both the drop point and the drag origin
// no-op, normal drop handling will take over
return;
}

if (isDropPoint) {
// The current instance is the drop point, but not the drag origin
// The current instance is the drop point

if (this.pmView.dragging) {
// Do not collapse selection when text content is being dragged
return;
}
// Because the editor selection is unrelated to the dragged content, we
// don't want PM to delete its content. Therefore, we collapse the
// selection.
Expand Down
Loading