From 98fb2a800929fe692f5a99a8ac7f9a289c408f57 Mon Sep 17 00:00:00 2001 From: Nick the Sick Date: Tue, 13 Jan 2026 11:23:12 +0100 Subject: [PATCH 1/2] fix: ignore drag & drop from unrelated events #1968 --- .../core/src/extensions/SideMenu/SideMenu.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/packages/core/src/extensions/SideMenu/SideMenu.ts b/packages/core/src/extensions/SideMenu/SideMenu.ts index 769e4a1715..26cad4e3bf 100644 --- a/packages/core/src/extensions/SideMenu/SideMenu.ts +++ b/packages/core/src/extensions/SideMenu/SideMenu.ts @@ -419,6 +419,23 @@ export class SideMenuView< * - Whether the drop event is within the bounds of the current editor instance */ getDragEventContext = (event: DragEvent) => { + // Relevance gate: Only handle drags that belong to BlockNote + // Check if at least one of the following is true: + // 1. ProseMirror drag started in an editor + // 2. Side menu drag + // 3. BlockNote-specific data type in the drag + // 4. (optional stricter mode) Event target is inside this editor + const isBlockNoteDrag = + this.pmView.dragging !== null || + this.isDragOrigin || + event.dataTransfer?.types.includes("blocknote/html") || + (event.target instanceof Node && this.pmView.dom.contains(event.target)); + + if (!isBlockNoteDrag) { + // Not a BlockNote-related drag, return early + return undefined; + } + // We need to check if there is text content that is being dragged (select some text & just drag it) const textContentIsBeingDragged = !event.dataTransfer?.types.includes("blocknote/html") && From 65c8a4d38a3b69a8383a9609f85e62f5b7865b62 Mon Sep 17 00:00:00 2001 From: Nick the Sick Date: Tue, 13 Jan 2026 15:29:54 +0100 Subject: [PATCH 2/2] fix: add more checks in other handlers --- .../core/src/extensions/SideMenu/SideMenu.ts | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/packages/core/src/extensions/SideMenu/SideMenu.ts b/packages/core/src/extensions/SideMenu/SideMenu.ts index 26cad4e3bf..e65d4b1d99 100644 --- a/packages/core/src/extensions/SideMenu/SideMenu.ts +++ b/packages/core/src/extensions/SideMenu/SideMenu.ts @@ -380,6 +380,20 @@ export class SideMenuView< return; } + // Relevance gate: Only handle drags that belong to BlockNote + // This prevents interference with external drag-and-drop libraries + // by avoiding calls to closeDropCursor() for non-BlockNote drags + const isBlockNoteDrag = + this.pmView.dragging !== null || + this.isDragOrigin || + event.dataTransfer?.types.includes("blocknote/html") || + (event.target instanceof Node && this.pmView.dom.contains(event.target)); + + if (!isBlockNoteDrag) { + // Not a BlockNote-related drag, return early without any processing + return; + } + const dragEventContext = this.getDragEventContext(event); if (!dragEventContext || !dragEventContext.isDropPoint) { @@ -494,6 +508,19 @@ export class SideMenuView< return; } + // Relevance gate: Only handle drags that belong to BlockNote + // This prevents interference with external drag-and-drop libraries + const isBlockNoteDrag = + this.pmView.dragging !== null || + this.isDragOrigin || + event.dataTransfer?.types.includes("blocknote/html") || + (event.target instanceof Node && this.pmView.dom.contains(event.target)); + + if (!isBlockNoteDrag) { + // Not a BlockNote-related drag, return early without any processing + return; + } + const context = this.getDragEventContext(event); if (!context) { this.closeDropCursor();