diff --git a/packages/block-editor/src/components/inserter/index.js b/packages/block-editor/src/components/inserter/index.js index f9117698f80b2..6fc5f13ae1861 100644 --- a/packages/block-editor/src/components/inserter/index.js +++ b/packages/block-editor/src/components/inserter/index.js @@ -156,7 +156,7 @@ export default compose( [ withDispatch( ( dispatch, ownProps, { select } ) => { return { insertOnlyAllowedBlock() { - const { rootClientId, clientId, isAppender, destinationRootClientId } = ownProps; + const { rootClientId, clientId, isAppender } = ownProps; const { hasSingleBlockType, allowedBlockType, @@ -176,17 +176,17 @@ export default compose( [ // If the clientId is defined, we insert at the position of the block. if ( clientId ) { - return getBlockIndex( clientId, destinationRootClientId ); + return getBlockIndex( clientId, rootClientId ); } // If there a selected block, we insert after the selected block. const end = getBlockSelectionEnd(); if ( ! isAppender && end ) { - return getBlockIndex( end, destinationRootClientId ) + 1; + return getBlockIndex( end, rootClientId ) + 1; } // Otherwise, we insert at the end of the current rootClientId - return getBlockOrder( destinationRootClientId ).length; + return getBlockOrder( rootClientId ).length; } const {