Skip to content

Commit b9c64ee

Browse files
authored
fix: resolve some minor drag & drop regressions (#1862)
1 parent 4d55c83 commit b9c64ee

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

packages/core/src/extensions/SideMenu/SideMenuPlugin.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -498,21 +498,19 @@ export class SideMenuView<
498498
}
499499
const { isDropPoint, isDropWithinEditorBounds, isDragOrigin } = context;
500500

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

507-
if (isDropPoint && isDragOrigin) {
508-
// The current instance is both the drop point and the drag origin
509-
// no-op, normal drop handling will take over
510-
return;
511-
}
512-
513507
if (isDropPoint) {
514-
// The current instance is the drop point, but not the drag origin
508+
// The current instance is the drop point
515509

510+
if (this.pmView.dragging) {
511+
// Do not collapse selection when text content is being dragged
512+
return;
513+
}
516514
// Because the editor selection is unrelated to the dragged content, we
517515
// don't want PM to delete its content. Therefore, we collapse the
518516
// selection.

0 commit comments

Comments
 (0)