From 2ee6440696f8fdcabf8c8ef9343fb18df6393bba Mon Sep 17 00:00:00 2001 From: Jorge Costa Date: Tue, 10 Dec 2024 12:30:38 +0000 Subject: [PATCH] [Dataviews] Fix: Space does not triggers the media button on grid view. --- .../src/dataviews-layouts/utils/get-clickable-item-props.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/dataviews/src/dataviews-layouts/utils/get-clickable-item-props.ts b/packages/dataviews/src/dataviews-layouts/utils/get-clickable-item-props.ts index e03e3a6351ec15..810f03cdfd3b76 100644 --- a/packages/dataviews/src/dataviews-layouts/utils/get-clickable-item-props.ts +++ b/packages/dataviews/src/dataviews-layouts/utils/get-clickable-item-props.ts @@ -25,7 +25,11 @@ export default function getClickableItemProps< Item >( { onClickItem( item ); }, onKeyDown: ( event: React.KeyboardEvent ) => { - if ( event.key === 'Enter' || event.key === '' ) { + if ( + event.key === 'Enter' || + event.key === '' || + event.key === ' ' + ) { // Prevents onChangeSelection from triggering. event.stopPropagation(); onClickItem( item );