Skip to content

Commit

Permalink
Only render the appender in currently selected menu
Browse files Browse the repository at this point in the history
  • Loading branch information
adamziel committed May 7, 2020
1 parent 6ede413 commit bb4ac8b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions packages/block-library/src/navigation-link/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,7 @@ function NavigationLinkEdit( {
<InnerBlocks
allowedBlocks={ [ 'core/navigation-link' ] }
renderAppender={
( hasDescendants && isSelected ) ||
isParentOfSelectedBlock
hasDescendants && isSelected
? InnerBlocks.DefaultAppender
: false
}
Expand Down
2 changes: 2 additions & 0 deletions packages/block-library/src/navigation/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import BlockColorsStyleSelector from './block-colors-selector';
import * as navIcons from './icons';

function Navigation( {
isSelected,
attributes,
clientId,
fontSize,
Expand Down Expand Up @@ -263,6 +264,7 @@ function Navigation( {
<InnerBlocks
ref={ ref }
allowedBlocks={ [ 'core/navigation-link' ] }
renderAppender={ isSelected ? InnerBlocks.DefaultAppender : false }
templateInsertUpdatesSelection={ false }
__experimentalMoverDirection={
attributes.orientation || 'horizontal'
Expand Down

0 comments on commit bb4ac8b

Please sign in to comment.