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 6acd954a5797b..c9d114fef0c7c 100644
--- a/packages/block-editor/src/components/block-list-appender/index.js
+++ b/packages/block-editor/src/components/block-list-appender/index.js
@@ -1,7 +1,6 @@
/**
* External dependencies
*/
-import { last } from 'lodash';
import classnames from 'classnames';
/**
@@ -18,7 +17,6 @@ import ButtonBlockAppender from '../button-block-appender';
import { store as blockEditorStore } from '../../store';
function BlockListAppender( {
- blockClientIds,
rootClientId,
canInsertDefaultBlock,
isLocked,
@@ -36,30 +34,18 @@ function BlockListAppender( {
// Prefer custom render prop if provided.
appender = ;
} else {
- const isDocumentAppender = ! rootClientId;
- const isParentSelected = selectedBlockClientId === rootClientId;
- const isAnotherDefaultAppenderAlreadyDisplayed =
- selectedBlockClientId &&
- ! blockClientIds.includes( selectedBlockClientId );
+ const isParentSelected =
+ selectedBlockClientId === rootClientId ||
+ ( ! rootClientId && ! selectedBlockClientId );
- if (
- ! isDocumentAppender &&
- ! isParentSelected &&
- ( ! selectedBlockClientId ||
- isAnotherDefaultAppenderAlreadyDisplayed )
- ) {
+ if ( ! isParentSelected ) {
return null;
}
if ( canInsertDefaultBlock ) {
// Render the default block appender when renderAppender has not been
// provided and the context supports use of the default appender.
- appender = (
-
- );
+ appender = ;
} else {
// Fallback in the case no renderAppender has been provided and the
// default block can't be inserted.
@@ -103,7 +89,6 @@ function BlockListAppender( {
export default withSelect( ( select, { rootClientId } ) => {
const {
- getBlockOrder,
canInsertBlockType,
getTemplateLock,
getSelectedBlockClientId,
@@ -111,7 +96,6 @@ export default withSelect( ( select, { rootClientId } ) => {
return {
isLocked: !! getTemplateLock( rootClientId ),
- blockClientIds: getBlockOrder( rootClientId ),
canInsertDefaultBlock: canInsertBlockType(
getDefaultBlockName(),
rootClientId
diff --git a/packages/block-editor/src/components/default-block-appender/index.js b/packages/block-editor/src/components/default-block-appender/index.js
index 16ead162ce11f..7795590320671 100644
--- a/packages/block-editor/src/components/default-block-appender/index.js
+++ b/packages/block-editor/src/components/default-block-appender/index.js
@@ -8,7 +8,6 @@ import classnames from 'classnames';
*/
import { __ } from '@wordpress/i18n';
import { compose } from '@wordpress/compose';
-import { getDefaultBlockName } from '@wordpress/blocks';
import { decodeEntities } from '@wordpress/html-entities';
import { withSelect, withDispatch } from '@wordpress/data';
@@ -26,13 +25,12 @@ export const ZWNBSP = '\ufeff';
export function DefaultBlockAppender( {
isLocked,
- isVisible,
onAppend,
showPrompt,
placeholder,
rootClientId,
} ) {
- if ( isLocked || ! isVisible ) {
+ if ( isLocked ) {
return null;
}
@@ -77,23 +75,14 @@ export function DefaultBlockAppender( {
export default compose(
withSelect( ( select, ownProps ) => {
- const {
- getBlockCount,
- getBlockName,
- isBlockValid,
- getSettings,
- getTemplateLock,
- } = select( blockEditorStore );
+ const { getBlockCount, getSettings, getTemplateLock } = select(
+ blockEditorStore
+ );
const isEmpty = ! getBlockCount( ownProps.rootClientId );
- const isLastBlockDefault =
- getBlockName( ownProps.lastBlockClientId ) ===
- getDefaultBlockName();
- const isLastBlockValid = isBlockValid( ownProps.lastBlockClientId );
const { bodyPlaceholder } = getSettings();
return {
- isVisible: isEmpty || ! isLastBlockDefault || ! isLastBlockValid,
showPrompt: isEmpty,
isLocked: !! getTemplateLock( ownProps.rootClientId ),
placeholder: bodyPlaceholder,
diff --git a/packages/block-editor/src/components/inner-blocks/default-block-appender.js b/packages/block-editor/src/components/inner-blocks/default-block-appender.js
index 86b66ec97c524..b6fc392cdcaef 100644
--- a/packages/block-editor/src/components/inner-blocks/default-block-appender.js
+++ b/packages/block-editor/src/components/inner-blocks/default-block-appender.js
@@ -16,13 +16,8 @@ import BaseDefaultBlockAppender from '../default-block-appender';
import withClientId from './with-client-id';
import { store as blockEditorStore } from '../../store';
-export const DefaultBlockAppender = ( { clientId, lastBlockClientId } ) => {
- return (
-
- );
+export const DefaultBlockAppender = ( { clientId } ) => {
+ return ;
};
export default compose( [