Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Blocks: Focus previous block when removing a block
  • Loading branch information
youknowriad committed May 8, 2017
commit 0d71661f681a6ebf6bc233504ba9c0f395154c2d
3 changes: 3 additions & 0 deletions editor/modes/visual-editor/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ class VisualEditorBlock extends wp.element.Component {
const { keyCode, target } = event;
if ( 8 /* Backspace */ === keyCode && target === this.node ) {
this.props.onRemove( this.props.uid );
if ( this.props.previousBlock ) {
this.props.onFocus( this.props.previousBlock.uid, { offset: -1 } );
}
}
}

Expand Down