Skip to content

Commit

Permalink
getSelectedBlockClientIds: Exclude widget area block and post title f…
Browse files Browse the repository at this point in the history
…rom block selection
  • Loading branch information
t-hamano committed May 24, 2022
1 parent 81dc943 commit 8e6b18e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/block-editor/src/store/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -707,9 +707,14 @@ export const getSelectedBlockClientIds = createSelector(
( state ) => {
const { selectionStart, selectionEnd } = state.selection;

if ( ! selectionStart.clientId || ! selectionEnd.clientId ) {
return EMPTY_ARRAY;
}

// Disable widget area selection.
if (
selectionStart.clientId === undefined ||
selectionEnd.clientId === undefined
getBlockName( state, selectionStart.clientId ) ===
'core/widget-area'
) {
return EMPTY_ARRAY;
}
Expand All @@ -725,6 +730,7 @@ export const getSelectedBlockClientIds = createSelector(
state,
selectionStart.clientId
);

if ( rootClientId === null ) {
return EMPTY_ARRAY;
}
Expand Down

0 comments on commit 8e6b18e

Please sign in to comment.