Skip to content

Commit

Permalink
Navigation: Add clearance for appender in submenus. (#36720)
Browse files Browse the repository at this point in the history
* Navigation: Add clearance for appender in submenus.

* Trying ButtonBlockAppender instead of DefaultBlockAppender

* Tweak the behavior.

Co-authored-by: George Hotelling <[email protected]>
  • Loading branch information
jasmussen and George Hotelling authored Dec 6, 2021
1 parent e629f5b commit cf61764
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/block-library/src/navigation-submenu/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ export default function NavigationSubmenuEdit( {
! selectedBlockHasDescendants ) ||
// Show the appender while dragging to allow inserting element between item and the appender.
hasDescendants
? InnerBlocks.DefaultAppender
? InnerBlocks.ButtonBlockAppender
: false,
}
);
Expand Down
12 changes: 12 additions & 0 deletions packages/block-library/src/navigation/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,18 @@
}
}

// Show even when a child is selected. This is an edgecase just for navigation submenus.
.is-editing > .wp-block-navigation__submenu-container > .block-list-appender {
display: block;
position: static;
}

// Hide when hovering.
.wp-block-navigation__submenu-container .block-list-appender {
display: none;
}


/**
* Colors Selector component
*/
Expand Down

0 comments on commit cf61764

Please sign in to comment.