Skip to content

Commit

Permalink
Enable movers only in nav block block navigator
Browse files Browse the repository at this point in the history
  • Loading branch information
talldan committed Oct 18, 2019
1 parent c545b22 commit f1d13f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ export default function BlockNavigationList( {
selectedBlockClientId,
selectBlock,
showNestedBlocks,
showMovers,
} ) {
const hasMovers = showMovers && blocks.length > 1;

return (
/*
* Disable reason: The `list` ARIA role is redundant but
Expand All @@ -70,14 +73,15 @@ export default function BlockNavigationList( {
{ getBlockDisplayName( blockType, block.attributes ) }
{ isSelected && <span className="screen-reader-text">{ __( '(selected block)' ) }</span> }
</Button>
{ blocks.length > 1 && ( <BlockMover clientIds={ [ block.clientId ] } /> ) }
{ hasMovers && ( <BlockMover clientIds={ [ block.clientId ] } /> ) }
</div>
{ showNestedBlocks && !! block.innerBlocks && !! block.innerBlocks.length && (
<BlockNavigationList
blocks={ block.innerBlocks }
selectedBlockClientId={ selectedBlockClientId }
selectBlock={ selectBlock }
showNestedBlocks
showMovers
/>
) }
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export default function useBlockNavigator( clientId ) {
selectedBlockClientId={ selectedBlockClientId }
selectBlock={ selectBlock }
showNestedBlocks
showMovers
/>
</Modal>
);
Expand Down

0 comments on commit f1d13f3

Please sign in to comment.