Skip to content

Commit

Permalink
Blocks: Avoid dismissing ediable 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 Feb 12, 2018
1 parent 0be8be5 commit 840fbec
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 @@ -110,7 +101,7 @@ class ReusableBlockEdit extends Component {
setAttributes={ isEditing ? this.setAttributes : noop }
/>
</div>,
isSelected && (
( isSelected || isEditing ) && (
<ReusableBlockEditPanel
key="panel"
isEditing={ isEditing }
Expand Down

0 comments on commit 840fbec

Please sign in to comment.