Skip to content

Commit

Permalink
feat: Show block remove button for empty (paragraph) block (#6589)
Browse files Browse the repository at this point in the history
Fix #6579
  • Loading branch information
tofumatt committed May 8, 2018
1 parent 9d4fd10 commit 268b871
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions editor/components/block-list/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,11 +426,11 @@ export class BlockListBlock extends Component {
// Empty paragraph blocks should always show up as unselected.
const isEmptyDefaultBlock = isUnmodifiedDefaultBlock( block );
const isSelectedNotTyping = isSelected && ! isTypingWithinBlock;
const showSideInserter = ( isSelected || isHovered ) && isEmptyDefaultBlock;
const shouldAppearSelected = ! showSideInserter && isSelectedNotTyping;
const showEmptyBlockSideInserter = ( isSelected || isHovered ) && isEmptyDefaultBlock;
const shouldAppearSelected = ! showEmptyBlockSideInserter && isSelectedNotTyping;
// We render block movers and block settings to keep them tabbale even if hidden
const shouldRenderMovers = ( isSelected || hoverArea === 'left' ) && ! showSideInserter && ! isMultiSelecting && ! isMultiSelected && ! isTypingWithinBlock;
const shouldRenderBlockSettings = ( isSelected || hoverArea === 'right' ) && ! showSideInserter && ! isMultiSelecting && ! isMultiSelected && ! isTypingWithinBlock;
const shouldRenderMovers = ( isSelected || hoverArea === 'left' ) && ! showEmptyBlockSideInserter && ! isMultiSelecting && ! isMultiSelected && ! isTypingWithinBlock;
const shouldRenderBlockSettings = ( isSelected || hoverArea === 'right' ) && ! isMultiSelecting && ! isMultiSelected && ! isTypingWithinBlock;
const shouldShowBreadcrumb = isHovered;
const shouldShowContextualToolbar = shouldAppearSelected && isValid && ( ! hasFixedToolbar || ! isLargeViewport );
const shouldShowMobileToolbar = shouldAppearSelected;
Expand Down Expand Up @@ -588,7 +588,7 @@ export class BlockListBlock extends Component {
) }
</IgnoreNestedEvents>
{ !! error && <BlockCrashWarning /> }
{ showSideInserter && (
{ showEmptyBlockSideInserter && (
<Fragment>
<div className="editor-block-list__side-inserter">
<InserterWithShortcuts uid={ uid } rootUID={ rootUID } layout={ layout } onToggle={ this.selectOnOpen } />
Expand Down

0 comments on commit 268b871

Please sign in to comment.