Skip to content

Commit

Permalink
Navigation: Fix issue where block collapses to zero height when empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmussen committed Feb 2, 2022
1 parent d6d6e09 commit 1993fbd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/block-library/src/navigation/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,17 @@ $color-control-label-height: 20px;
}
}

// Selected "Start empty" state.
// In this state, the block is entirely empty and will collapse to zero height unless there's
// content inside. The below rule lets the placeholder staty in an invisible state to avoid
// collapse and layout shift.
// @todo: This fix could be augmented with showing the generic appender when there are no
// innerblocks, a la how the Row block does it.
.wp-block-navigation.is-selected .wp-block-navigation__container .wp-block-navigation-placeholder__preview:first-of-type {
visibility: hidden;
display: flex;
}

// Selected state.
.wp-block-navigation-placeholder__preview,
.wp-block-navigation-placeholder__controls {
Expand Down

0 comments on commit 1993fbd

Please sign in to comment.