From e7094ff4410cdd75abdfa0749841c7f87361dea5 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Mon, 19 Jun 2017 11:15:03 +0100 Subject: [PATCH] Blocks: Fix deleting text when deleting the next image block --- editor/modes/visual-editor/block.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/editor/modes/visual-editor/block.js b/editor/modes/visual-editor/block.js index 10ac502309c04..b8242985069e3 100644 --- a/editor/modes/visual-editor/block.js +++ b/editor/modes/visual-editor/block.js @@ -151,7 +151,8 @@ class VisualEditorBlock extends wp.element.Component { this.props.onStopTyping(); } - removeOrDeselect( { keyCode, target } ) { + removeOrDeselect( event ) { + const { keyCode, target } = event; const { uid, multiSelectedBlockUids, @@ -163,6 +164,7 @@ class VisualEditorBlock extends wp.element.Component { // Remove block on backspace. if ( BACKSPACE === keyCode ) { + event.preventDefault(); if ( target === this.node ) { onRemove( [ uid ] );