Skip to content

Commit

Permalink
Blocks: Fix deleting text when deleting the next image block
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Jun 19, 2017
1 parent a0bb3a3 commit 6c745d1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion editor/modes/visual-editor/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 ] );

Expand Down

0 comments on commit 6c745d1

Please sign in to comment.