From 59708baed3b7169ba5cbfaeac02110b332a0d15e Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Thu, 28 Nov 2024 17:33:10 +0100 Subject: [PATCH] Stop propagation --- .../src/dataviews-layouts/utils/get-clickable-item-props.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 36969b65edf1b8..efb4a8f598c7b8 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 @@ -13,13 +13,13 @@ export default function getClickableItemProps< Item >( role: 'button', tabIndex: 0, onClick: ( event: React.MouseEvent ) => { - event.preventDefault(); + // Prevents onChangeSelection from triggering. event.stopPropagation(); onClickItem( item ); }, onKeyDown: ( event: React.KeyboardEvent ) => { if ( event.key === 'Enter' || event.key === '' ) { - event.preventDefault(); + // Prevents onChangeSelection from triggering. event.stopPropagation(); onClickItem( item ); }