diff --git a/packages/eds-data-grid-react/src/EdsDataGrid.tsx b/packages/eds-data-grid-react/src/EdsDataGrid.tsx index 70f3e65881..d5bbae311b 100644 --- a/packages/eds-data-grid-react/src/EdsDataGrid.tsx +++ b/packages/eds-data-grid-react/src/EdsDataGrid.tsx @@ -98,6 +98,7 @@ function EdsDataGridInner( defaultColumn, onRowContextMenu, onRowClick, + onRowDoubleClick, onCellClick, enableFooter, enableSortingRemoval, @@ -485,6 +486,11 @@ function EdsDataGridInner( ? (event) => onRowClick(row, event) : undefined } + onDoubleClick={ + onRowDoubleClick + ? (event) => onRowDoubleClick(row, event) + : undefined + } onCellClick={onCellClick} /> ) diff --git a/packages/eds-data-grid-react/src/EdsDataGridProps.ts b/packages/eds-data-grid-react/src/EdsDataGridProps.ts index 5a85c12d11..b1cebaf186 100644 --- a/packages/eds-data-grid-react/src/EdsDataGridProps.ts +++ b/packages/eds-data-grid-react/src/EdsDataGridProps.ts @@ -229,6 +229,17 @@ type HandlersProps = { * @returns */ onRowClick?: (row: Row, event: MouseEvent) => unknown + /** + * Row double-click handler. + * + * @param row The current row + * @param event The click event + * @returns + */ + onRowDoubleClick?: ( + row: Row, + event: MouseEvent, + ) => unknown /** * Cell click handler. * diff --git a/packages/eds-data-grid-react/src/components/TableRow.tsx b/packages/eds-data-grid-react/src/components/TableRow.tsx index 5427f3fcd3..65f3f66a36 100644 --- a/packages/eds-data-grid-react/src/components/TableRow.tsx +++ b/packages/eds-data-grid-react/src/components/TableRow.tsx @@ -15,6 +15,7 @@ export function TableRow({ row, onCellClick, onClick, + onDoubleClick, onContextMenu, }: Props) { const { rowClass, rowStyle } = useTableContext() @@ -26,6 +27,7 @@ export function TableRow({ }} className={`${row.getIsSelected() ? 'selected' : ''} ${rowClass?.(row)}`} onClick={onClick} + onDoubleClick={onDoubleClick} onContextMenu={onContextMenu} > {row.getVisibleCells().map((cell) => (