Skip to content

Commit

Permalink
Blocks: Avoid dismissing editable controls
Browse files Browse the repository at this point in the history
In nested context, block selection changes from reusable block to the inner block being edited, but we want to keep the UI shown
  • Loading branch information
aduth committed Mar 7, 2018
1 parent a3e8dfd commit 7d0bdde
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions blocks/library/block/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,6 @@ class ReusableBlockEdit extends Component {
}
}

/**
* @inheritdoc
*/
componentWillReceiveProps( nextProps ) {
if ( this.props.focus && ! nextProps.focus ) {
this.stopEditing();
}
}

startEditing() {
this.setState( { isEditing: true } );
}
Expand Down Expand Up @@ -117,7 +108,7 @@ class ReusableBlockEdit extends Component {
return (
<Fragment>
{ element }
{ isSelected && (
{ ( isSelected || isEditing ) && (
<ReusableBlockEditPanel
key="panel"
isEditing={ isEditing }
Expand Down

0 comments on commit 7d0bdde

Please sign in to comment.