Skip to content

Commit

Permalink
Blocks: Only prevent backspace if we trigger block deletions
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Jun 19, 2017
1 parent 6c745d1 commit cd20842
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion editor/modes/visual-editor/block.js
Expand Up @@ -164,8 +164,8 @@ class VisualEditorBlock extends wp.element.Component {

// Remove block on backspace.
if ( BACKSPACE === keyCode ) {
event.preventDefault();
if ( target === this.node ) {
event.preventDefault();
onRemove( [ uid ] );

if ( previousBlock ) {
Expand All @@ -174,6 +174,7 @@ class VisualEditorBlock extends wp.element.Component {
}

if ( multiSelectedBlockUids.length ) {
event.preventDefault();
onRemove( multiSelectedBlockUids );
}
}
Expand Down

0 comments on commit cd20842

Please sign in to comment.