From 7d0bdde2d33ba25647b344b5fe323f7a48a70f23 Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Mon, 12 Feb 2018 14:30:50 -0500 Subject: [PATCH] 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 --- 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 717addd73c76d..41be2c07b9c2d 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 } ); } @@ -117,7 +108,7 @@ class ReusableBlockEdit extends Component { return ( { element } - { isSelected && ( + { ( isSelected || isEditing ) && (