fix(drag-n-drop): prevent block selection on file drop (#2980)

Prevent block selection when dropping files. Resolves issue #2980.
This commit is contained in:
Kalyan Srinivas Mantha 2026-01-27 11:31:44 -08:00
commit 3d93eef905

View file

@ -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)();
}
/**