diff --git a/packages/block-editor/src/components/list-view/block-select-button.js b/packages/block-editor/src/components/list-view/block-select-button.js index 99fd51b9ebb41f..5c20bc37b11486 100644 --- a/packages/block-editor/src/components/list-view/block-select-button.js +++ b/packages/block-editor/src/components/list-view/block-select-button.js @@ -19,6 +19,7 @@ import useBlockDisplayInformation from '../use-block-display-information'; import { getBlockPositionDescription } from './utils'; import BlockTitle from '../block-title'; import ListViewExpander from './expander'; +import { SPACE, ENTER } from '@wordpress/keycodes'; function ListViewBlockSelectButton( { @@ -30,7 +31,6 @@ function ListViewBlockSelectButton( position, siblingBlockCount, level, - tabIndex, onFocus, onDragStart, onDragEnd, @@ -56,6 +56,13 @@ function ListViewBlockSelectButton( onDragStart( event ); }; + function onKeyDownHandler( event ) { + if ( event.keyCode === ENTER || event.keyCode === SPACE ) { + event.preventDefault(); + onClick( event ); + } + } + return ( <>