From ca5368a42847d3fe08b199db3141e3680d407af0 Mon Sep 17 00:00:00 2001 From: evgen Date: Sun, 3 Nov 2019 10:57:06 +0300 Subject: [PATCH] Delete button merges blocks instead of deleting highlighted text --- src/components/modules/blockEvents.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/modules/blockEvents.ts b/src/components/modules/blockEvents.ts index dd95ccd4c..e43a701e2 100644 --- a/src/components/modules/blockEvents.ts +++ b/src/components/modules/blockEvents.ts @@ -420,7 +420,8 @@ export default class BlockEvents extends Module { } const isFirstBlock = BlockManager.currentBlockIndex === 0; - const canMergeBlocks = Caret.isAtStart && currentBlock.currentInput === currentBlock.firstInput && !isFirstBlock; + const almostAllSelected = SelectionUtils.almostAllSelected(currentBlock.pluginsContent.textContent); + const canMergeBlocks = Caret.isAtStart && currentBlock.currentInput === currentBlock.firstInput && !isFirstBlock && !almostAllSelected; if (canMergeBlocks) { /**