diff --git a/packages/block-editor/src/components/list-view/appender.js b/packages/block-editor/src/components/list-view/appender.js index 9819e37920d631..db3f617f1a6de0 100644 --- a/packages/block-editor/src/components/list-view/appender.js +++ b/packages/block-editor/src/components/list-view/appender.js @@ -75,6 +75,10 @@ export const Appender = forwardRef( }, [ insertedBlockTitle ] ); const orderInitialBlockItems = useCallback( ( items ) => { + if ( ! prioritizedInserterBlocks.length ) { + return items; + } + items.sort( ( { id: aName }, { id: bName } ) => { // Sort block items according to `prioritizedInserterBlocks`. let aIndex = prioritizedInserterBlocks.indexOf( aName );