Skip to content

Commit

Permalink
Prevent unexpected copying of the post title (#41284)
Browse files Browse the repository at this point in the history
* getSelectedBlockClientIds: Exclude widget area block and post title from block selection

* Don't execute copy handler if widget area block is included

* Revert widget-area change
  • Loading branch information
t-hamano authored Oct 31, 2022
1 parent f18d346 commit cba9df0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/block-editor/src/store/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -695,10 +695,7 @@ export const getSelectedBlockClientIds = createSelector(
( state ) => {
const { selectionStart, selectionEnd } = state.selection;

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

Expand All @@ -713,6 +710,7 @@ export const getSelectedBlockClientIds = createSelector(
state,
selectionStart.clientId
);

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

0 comments on commit cba9df0

Please sign in to comment.