Skip to content

Commit

Permalink
SiblingInserter: Opening should clear block selection
Browse files Browse the repository at this point in the history
… thus hiding any selected block's chrome.
  • Loading branch information
mcsf committed Jan 4, 2018
1 parent ba4e71e commit c22cc94
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions editor/components/block-list/sibling-inserter.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ import {
isBlockInsertionPointVisible,
isBlockWithinSelection,
} from '../../store/selectors';
import {
clearSelectedBlock,
} from '../../store/actions';

class BlockListSiblingInserter extends Component {
constructor() {
Expand All @@ -35,6 +38,10 @@ class BlockListSiblingInserter extends Component {
// Prevent mouseout and blur while navigating the open inserter menu
// from causing the inserter to be unmounted.
this.setState( { isForcedVisible: isOpen } );

if ( isOpen ) {
this.props.clearSelectedBlock();
}
}

render() {
Expand Down Expand Up @@ -81,5 +88,8 @@ export default connect(
getBlockInsertionPoint( state ) === insertIndex
),
};
},
{
clearSelectedBlock,
}
)( BlockListSiblingInserter );

0 comments on commit c22cc94

Please sign in to comment.