diff --git a/packages/block-editor/src/components/list-view/block-select-button.js b/packages/block-editor/src/components/list-view/block-select-button.js index 21759d205845a..068688a7d5603 100644 --- a/packages/block-editor/src/components/list-view/block-select-button.js +++ b/packages/block-editor/src/components/list-view/block-select-button.js @@ -84,7 +84,11 @@ function ListViewBlockSelectButton( aria-expanded={ isExpanded } > - + { const { @@ -130,11 +133,14 @@ function ListViewComponent( setExpandedState, } ); const selectEditorBlock = useCallback( - ( event, clientId ) => { - updateBlockSelection( event, clientId ); - setSelectedTreeId( clientId ); + ( event, blockClientId ) => { + updateBlockSelection( event, blockClientId ); + setSelectedTreeId( blockClientId ); + if ( onSelect ) { + onSelect( getBlock( blockClientId ) ); + } }, - [ setSelectedTreeId, updateBlockSelection ] + [ setSelectedTreeId, updateBlockSelection, onSelect, getBlock ] ); useEffect( () => { isMounted.current = true; @@ -268,6 +274,7 @@ export default forwardRef( ( props, ref ) => { showAppender={ false } blockSettingsMenu={ BlockSettingsDropdown } rootClientId={ null } + onSelect={ null } renderAdditionalBlockUICallback={ null } /> ); diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js b/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js index 2981c57c19fd1..d7d4e18fc2b51 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js @@ -144,7 +144,7 @@ export default function NavigationMenuContent( { rootClientId, onSelect } ) { }; }, [ shouldKeepLoading, clientIdsTree, isLoading ] ); - const { OffCanvasEditor, LeafMoreMenu } = unlock( blockEditorPrivateApis ); + const { PrivateListView, LeafMoreMenu } = unlock( blockEditorPrivateApis ); const offCanvasOnselect = useCallback( ( block ) => { @@ -181,14 +181,14 @@ export default function NavigationMenuContent( { rootClientId, onSelect } ) { <> { isLoading && } { ! isLoading && ( -