Skip to content

Commit

Permalink
Blocks: Scroll the page to the inserted block
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed May 10, 2017
1 parent 5db971a commit 94b8fce
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions editor/modes/visual-editor/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ class VisualEditorBlock extends wp.element.Component {
}
}

componentDidMount() {
if ( this.props.focus ) {
this.node.focus();
}
}

render() {
const { block } = this.props;
const settings = wp.blocks.getBlockSettings( block.blockType );
Expand Down

0 comments on commit 94b8fce

Please sign in to comment.