Skip to content

Commit 7d0bdde

Browse files
committed
Blocks: Avoid dismissing editable controls
In nested context, block selection changes from reusable block to the inner block being edited, but we want to keep the UI shown
1 parent a3e8dfd commit 7d0bdde

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

blocks/library/block/index.js

+1-10
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,6 @@ class ReusableBlockEdit extends Component {
4040
}
4141
}
4242

43-
/**
44-
* @inheritdoc
45-
*/
46-
componentWillReceiveProps( nextProps ) {
47-
if ( this.props.focus && ! nextProps.focus ) {
48-
this.stopEditing();
49-
}
50-
}
51-
5243
startEditing() {
5344
this.setState( { isEditing: true } );
5445
}
@@ -117,7 +108,7 @@ class ReusableBlockEdit extends Component {
117108
return (
118109
<Fragment>
119110
{ element }
120-
{ isSelected && (
111+
{ ( isSelected || isEditing ) && (
121112
<ReusableBlockEditPanel
122113
key="panel"
123114
isEditing={ isEditing }

0 commit comments

Comments
 (0)