diff --git a/packages/block-editor/src/components/block-list-appender/index.js b/packages/block-editor/src/components/block-list-appender/index.js index dda72ea6b22d1..e2a4dbb0ebd6b 100644 --- a/packages/block-editor/src/components/block-list-appender/index.js +++ b/packages/block-editor/src/components/block-list-appender/index.js @@ -38,9 +38,7 @@ function BlockListAppender( { if ( CustomAppender ) { // Prefer custom render prop if provided. appender = ; - } else if ( canInsertDefaultBlock ) { - // Render the default block appender when renderAppender has not been - // provided and the context supports use of the default appender. + } else { const isDocumentAppender = ! rootClientId; const isParentSelected = selectedBlockClientId === rootClientId; const isAnotherDefaultAppenderAlreadyDisplayed = @@ -50,26 +48,31 @@ function BlockListAppender( { if ( ! isDocumentAppender && ! isParentSelected && - isAnotherDefaultAppenderAlreadyDisplayed + ( ! selectedBlockClientId || + isAnotherDefaultAppenderAlreadyDisplayed ) ) { return null; } - appender = ( - - ); - } else { - // Fallback in the case no renderAppender has been provided and the - // default block can't be inserted. - appender = ( - - ); + if ( canInsertDefaultBlock ) { + // Render the default block appender when renderAppender has not been + // provided and the context supports use of the default appender. + appender = ( + + ); + } else { + // Fallback in the case no renderAppender has been provided and the + // default block can't be inserted. + appender = ( + + ); + } } return ( diff --git a/packages/block-editor/src/components/block-list/index.js b/packages/block-editor/src/components/block-list/index.js index b1ce89ab83e9d..a4dc285582a6c 100644 --- a/packages/block-editor/src/components/block-list/index.js +++ b/packages/block-editor/src/components/block-list/index.js @@ -80,8 +80,8 @@ function BlockList( return ( - - - - + + + ); } diff --git a/packages/block-library/src/buttons/editor.scss b/packages/block-library/src/buttons/editor.scss index 2a07114b65ad5..f19c277c5fc3d 100644 --- a/packages/block-library/src/buttons/editor.scss +++ b/packages/block-library/src/buttons/editor.scss @@ -1,6 +1,9 @@ .wp-block-buttons .wp-block.block-editor-block-list__block[data-type="core/button"] { display: inline-block; width: auto; + + // Override editor auto block margins. + margin-left: 0; } .wp-block[data-align="center"] > .wp-block-buttons {