diff --git a/src/generic/DraggableList/SortableItem.tsx b/src/generic/DraggableList/SortableItem.tsx index a35e28b8f..cd2d552bb 100644 --- a/src/generic/DraggableList/SortableItem.tsx +++ b/src/generic/DraggableList/SortableItem.tsx @@ -1,4 +1,4 @@ -import React, { MouseEventHandler } from 'react'; +import React, { KeyboardEventHandler, MouseEventHandler } from 'react'; import { useSortable } from '@dnd-kit/sortable'; import { CSS } from '@dnd-kit/utilities'; import { @@ -16,6 +16,7 @@ interface SortableItemProps { componentStyle?: {}, isClickable?: boolean, onClick?: MouseEventHandler, + onKeyDown?: KeyboardEventHandler, disabled?: boolean, cardClassName?: string, } @@ -28,6 +29,7 @@ const SortableItem = ({ children, isClickable, onClick, + onKeyDown, disabled, cardClassName = '', }: SortableItemProps) => { @@ -60,6 +62,7 @@ const SortableItem = ({
!readOnly && handleChildClick(child, e.detail)} + isClickable + onClick={(e) => handleChildClick(child, e.detail)} + onKeyDown={(e) => { + if (e.key === 'Enter') { + handleChildClick(child, 1); + } + }} disabled={readOnly || libReadOnly} cardClassName={sidebarItemInfo?.id === child.originalId ? 'selected' : undefined} actions={(