diff --git a/packages/block-editor/src/components/copy-handler/index.js b/packages/block-editor/src/components/copy-handler/index.js index 0958bac863216b..ecaf509e435f9d 100644 --- a/packages/block-editor/src/components/copy-handler/index.js +++ b/packages/block-editor/src/components/copy-handler/index.js @@ -75,6 +75,7 @@ export function useNotifyCopy() { export function useClipboardHandler() { const { getBlocksByClientId, + getBlockName, getSelectedBlockClientIds, hasMultiSelection, getSettings, @@ -100,6 +101,14 @@ export function useClipboardHandler() { return; } + // Don't execute if widget area block is included + if ( + getBlockName( selectedBlockClientIds[ 0 ] ) === + 'core/widget-area' + ) { + return; + } + // Always handle multiple selected blocks. if ( ! hasMultiSelection() ) { const { target } = event; diff --git a/packages/block-editor/src/store/selectors.js b/packages/block-editor/src/store/selectors.js index e3ba042e51525e..8d3b5307f5d3ca 100644 --- a/packages/block-editor/src/store/selectors.js +++ b/packages/block-editor/src/store/selectors.js @@ -711,14 +711,6 @@ export const getSelectedBlockClientIds = createSelector( return EMPTY_ARRAY; } - // Disable widget area selection. - if ( - getBlockName( state, selectionStart.clientId ) === - 'core/widget-area' - ) { - return EMPTY_ARRAY; - } - if ( selectionStart.clientId === selectionEnd.clientId ) { return [ selectionStart.clientId ]; }