From 3d93eef905e6c4348fa70902df1b92dc256b3ca0 Mon Sep 17 00:00:00 2001 From: Kalyan Srinivas Mantha Date: Tue, 27 Jan 2026 11:31:44 -0800 Subject: [PATCH] fix(drag-n-drop): prevent block selection on file drop (#2980) Prevent block selection when dropping files. Resolves issue #2980. --- src/components/modules/dragNDrop.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/modules/dragNDrop.ts b/src/components/modules/dragNDrop.ts index 3826365c2..1618e3631 100644 --- a/src/components/modules/dragNDrop.ts +++ b/src/components/modules/dragNDrop.ts @@ -92,14 +92,18 @@ export default class DragNDrop extends Module { const targetBlock = BlockManager.setCurrentBlockByChildNode(dropEvent.target as Node); if (targetBlock) { - this.Editor.Caret.setToBlock(targetBlock, Caret.positions.END); + // this.Editor.Caret.setToBlock(targetBlock, Caret.positions.END); } else { - const lastBlock = BlockManager.setCurrentBlockByChildNode(BlockManager.lastBlock.holder); + // const lastBlock = BlockManager.setCurrentBlockByChildNode(BlockManager.lastBlock.holder); - this.Editor.Caret.setToBlock(lastBlock, Caret.positions.END); + // this.Editor.Caret.setToBlock(lastBlock, Caret.positions.END); } await Paste.processDataTransfer(dropEvent.dataTransfer, true); + + _.delay(() => { + this.Editor.BlockSelection.clearSelection(); + }, 50)(); } /**