Skip to content

Commit 3b62ee1

Browse files
committed
fix: prevent duplicate items when dragging content within the editor
1 parent 1ae2d78 commit 3b62ee1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,14 @@ export class SideMenuView<
286286
return;
287287
}
288288

289+
if (
290+
this.sideMenuDetection === "editor" ||
291+
(event as any).synthetic ||
292+
!event.dataTransfer?.types.includes("blocknote/html")
293+
) {
294+
return;
295+
}
296+
289297
this.editor._tiptapEditor.commands.blur();
290298

291299
// Finds the BlockNote editor element that the drop event occurred in (if
@@ -335,14 +343,6 @@ export class SideMenuView<
335343
}
336344
}
337345

338-
if (
339-
this.sideMenuDetection === "editor" ||
340-
(event as any).synthetic ||
341-
!event.dataTransfer?.types.includes("blocknote/html")
342-
) {
343-
return;
344-
}
345-
346346
const pos = this.pmView.posAtCoords({
347347
left: event.clientX,
348348
top: event.clientY,

0 commit comments

Comments
 (0)