Skip to content

Commit

Permalink
Navigation: Fix submenus not showing on click. (#35716)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmussen authored Oct 18, 2021
1 parent 07eb9a1 commit 4cce582
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/block-library/src/navigation-submenu/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
width: auto !important;
// These styles are needed to display the dropdown properly when it is empty.
position: absolute;
left: -1em;
left: -1px; // Border width.
top: 100%;

@include break-medium {
Expand Down
12 changes: 5 additions & 7 deletions packages/block-library/src/navigation/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,10 @@
// Don't take up space when the menu is collapsed.
width: 0;
height: 0;
overflow: hidden;

// Submenu items.
> .wp-block-navigation-item {
> a {
> .wp-block-navigation-item__content {
display: flex;
flex-grow: 1;

Expand All @@ -142,12 +141,12 @@
}

// Spacing in all submenus.
a {
.wp-block-navigation-item__content {
margin: 0;
}

// Submenu indentation when there's no background.
left: -1em;
left: -1px; // Border width.
top: 100%;

// Indentation for all submenus.
Expand Down Expand Up @@ -184,7 +183,6 @@
opacity: 1;
width: auto;
height: auto;
overflow: initial;
min-width: 200px;
}

Expand Down Expand Up @@ -253,7 +251,7 @@
// https://css-tricks.com/almanac/selectors/w/where/

// Set the default menu item padding to zero, to allow text-only buttons.
.wp-block-navigation a {
.wp-block-navigation .wp-block-navigation-item__content {
padding: 0;
}

Expand All @@ -264,7 +262,7 @@
}

// Provide a default padding for submenus who should always have some, regardless of the top level menu items.
.wp-block-navigation :where(.wp-block-navigation__submenu-container) a {
.wp-block-navigation :where(.wp-block-navigation__submenu-container) .wp-block-navigation-item__content {
padding: 0.5em 1em;
}

Expand Down

0 comments on commit 4cce582

Please sign in to comment.