From 2b7f43a20b71dd6ac9615fe6a294941f13055bb6 Mon Sep 17 00:00:00 2001 From: Jerry Jones Date: Sun, 6 Oct 2024 14:37:38 -0500 Subject: [PATCH] Remove orphaned select ref code (#65834) --- .../block-editor/src/components/block-tools/index.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/packages/block-editor/src/components/block-tools/index.js b/packages/block-editor/src/components/block-tools/index.js index bad331561317f8..cbcb5b8e50b09a 100644 --- a/packages/block-editor/src/components/block-tools/index.js +++ b/packages/block-editor/src/components/block-tools/index.js @@ -25,7 +25,6 @@ import usePopoverScroll from '../block-popover/use-popover-scroll'; import ZoomOutModeInserters from './zoom-out-mode-inserters'; import { useShowBlockTools } from './use-show-block-tools'; import { unlock } from '../../lock-unlock'; -import getEditorRegion from '../../utils/get-editor-region'; function selector( select ) { const { @@ -83,7 +82,6 @@ export default function BlockTools( { } = useShowBlockTools(); const { - clearSelectedBlock, duplicateBlocks, removeBlocks, replaceBlocks, @@ -95,8 +93,6 @@ export default function BlockTools( { expandBlock, } = unlock( useDispatch( blockEditorStore ) ); - const blockSelectionButtonRef = useRef(); - function onKeyDown( event ) { if ( event.defaultPrevented ) { return; @@ -157,13 +153,6 @@ export default function BlockTools( { // block so that focus is directed back to the beginning of the selection. // In effect, to the user this feels like deselecting the multi-selection. selectBlock( clientIds[ 0 ] ); - } else if ( - clientIds.length === 1 && - event.target === blockSelectionButtonRef?.current - ) { - event.preventDefault(); - clearSelectedBlock(); - getEditorRegion( __unstableContentRef.current )?.focus(); } } else if ( isMatch( 'core/block-editor/collapse-list-view', event ) ) { // If focus is currently within a text field, such as a rich text block or other editable field,