diff --git a/packages/core/src/extensions/SideMenu/SideMenuPlugin.ts b/packages/core/src/extensions/SideMenu/SideMenuPlugin.ts index 6b2060d73c..7a744540bf 100644 --- a/packages/core/src/extensions/SideMenu/SideMenuPlugin.ts +++ b/packages/core/src/extensions/SideMenu/SideMenuPlugin.ts @@ -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.