From 840fbec793462039b3cd3279ae807516a0a1a27c Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Mon, 12 Feb 2018 14:30:50 -0500 Subject: [PATCH] Blocks: Avoid dismissing ediable controls In nested context, block selection changes from reusable block to the inner block being edited, but we want to keep the UI shown --- blocks/library/block/index.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/blocks/library/block/index.js b/blocks/library/block/index.js index 31efe46ad53bf..9cd305f7e93f5 100644 --- a/blocks/library/block/index.js +++ b/blocks/library/block/index.js @@ -40,15 +40,6 @@ class ReusableBlockEdit extends Component { } } - /** - * @inheritdoc - */ - componentWillReceiveProps( nextProps ) { - if ( this.props.focus && ! nextProps.focus ) { - this.stopEditing(); - } - } - startEditing() { this.setState( { isEditing: true } ); } @@ -110,7 +101,7 @@ class ReusableBlockEdit extends Component { setAttributes={ isEditing ? this.setAttributes : noop } /> , - isSelected && ( + ( isSelected || isEditing ) && (