Skip to content

Commit

Permalink
Block Movers: Hide movers if there are no blocks before and after. (#…
Browse files Browse the repository at this point in the history
…8011)

If there are no blocks before or after the group of selected blocks, it is not possible to move the blocks anywhere.
In that case, we should not show the movers. Not showing the movers for this cases makes the UI cleaner in nested contexts as discovered in #7414.
  • Loading branch information
jorgefilipecosta committed Aug 2, 2018
1 parent a942c45 commit e041770
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/editor/src/components/block-mover/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class BlockMover extends Component {
const { onMoveUp, onMoveDown, isFirst, isLast, clientIds, blockType, firstIndex, isLocked, instanceId, isHidden } = this.props;
const { isFocused } = this.state;
const blocksCount = castArray( clientIds ).length;
if ( isLocked ) {
if ( isLocked || ( isFirst && isLast ) ) {
return null;
}

Expand Down

0 comments on commit e041770

Please sign in to comment.