Skip to content

Commit

Permalink
Makes appenders visible only for the current selection (#19598)
Browse files Browse the repository at this point in the history
* makes appenders visible only for the current selection

* adds smaller footprint to appenders in navigation, only shows them if item has descendants

* align appender to level of the menu item, remove useless CSS
  • Loading branch information
draganescu authored Jan 21, 2020
1 parent cd309db commit 24c0e60
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/block-library/src/navigation-link/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ function NavigationLinkEdit( {
</div>
<InnerBlocks
allowedBlocks={ [ 'core/navigation-link' ] }
renderAppender={ hasDescendants ? InnerBlocks.ButtonBlockAppender : false }
renderAppender={ ( hasDescendants && isSelected ) ? InnerBlocks.DefaultAppender : false }
/>
</div>
</Fragment>
Expand Down
6 changes: 6 additions & 0 deletions packages/block-library/src/navigation/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,15 @@ $navigation-item-height: 46px;
// Polish the Appender.
.wp-block-navigation .block-list-appender {
margin: 0;
width: 28px;
height: 28px;
margin-top: $grid-size-small;
margin-left: $grid-size + $block-side-ui-clearance;

.block-editor-button-block-appender {
padding: $grid-size;
padding-bottom: $grid-size-small;
padding-top: $grid-size-small;
outline: none;
background: none;
}
Expand Down
1 change: 0 additions & 1 deletion packages/block-library/src/navigation/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.wp-block-navigation {

& > ul {
display: block;
list-style: none;
Expand Down

0 comments on commit 24c0e60

Please sign in to comment.