From 32ab7aed7ed46873208546450801e65e6cf67a93 Mon Sep 17 00:00:00 2001 From: ramonjd Date: Mon, 25 Oct 2021 18:15:38 +1100 Subject: [PATCH] Renamed parent client id array to `selectedBlockParentClientIds` --- .../block-editor/src/components/list-view/index.js | 10 +++++----- .../components/list-view/use-list-view-client-ids.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/block-editor/src/components/list-view/index.js b/packages/block-editor/src/components/list-view/index.js index f79eaeb58cceb..dc3280ec39dbf 100644 --- a/packages/block-editor/src/components/list-view/index.js +++ b/packages/block-editor/src/components/list-view/index.js @@ -69,7 +69,7 @@ function ListView( const { clientIdsTree, draggedClientIds, - selectedBlockParentIds, + selectedBlockParentClientIds, } = useListViewClientIds( blocks ); const { selectBlock } = useDispatch( blockEditorStore ); const selectEditorBlock = useCallback( @@ -150,10 +150,10 @@ function ListView( useEffect( () => { if ( ! hasFocus && - Array.isArray( selectedBlockParentIds ) && - selectedBlockParentIds.length + Array.isArray( selectedBlockParentClientIds ) && + selectedBlockParentClientIds.length ) { - selectedBlockParentIds.forEach( ( clientId ) => { + selectedBlockParentClientIds.forEach( ( clientId ) => { if ( ! expandedState[ clientId ] ) { setExpandedState( { type: 'expand', @@ -162,7 +162,7 @@ function ListView( } } ); } - }, [ hasFocus, selectedBlockParentIds ] ); + }, [ hasFocus, selectedBlockParentClientIds ] ); return ( diff --git a/packages/block-editor/src/components/list-view/use-list-view-client-ids.js b/packages/block-editor/src/components/list-view/use-list-view-client-ids.js index c09f5833def2a..d30ee7dfdfd7f 100644 --- a/packages/block-editor/src/components/list-view/use-list-view-client-ids.js +++ b/packages/block-editor/src/components/list-view/use-list-view-client-ids.js @@ -23,7 +23,7 @@ export default function useListViewClientIds( blocks ) { return { draggedClientIds: getDraggedBlockClientIds(), clientIdsTree: blocks ? blocks : __unstableGetClientIdsTree(), - selectedBlockParentIds: getBlockParents( + selectedBlockParentClientIds: getBlockParents( selectedBlockClientIds[ 0 ], false ),