diff --git a/src/lib/DataTable.tsx b/src/lib/DataTable.tsx index e77bd62..3e22669 100644 --- a/src/lib/DataTable.tsx +++ b/src/lib/DataTable.tsx @@ -1185,8 +1185,9 @@ class DataTableView extends React.Component, DataTableViewS const _getOnClick = typeof onClick === 'function' - ? (data: {row: T; index: number; footer?: boolean; headerData?: boolean}) => () => - onClick(data, column) + ? (data: {row: T; index: number; footer?: boolean; headerData?: boolean}) => + (event: React.MouseEvent) => + onClick(data, column, event) : () => undefined; return { diff --git a/src/lib/types.ts b/src/lib/types.ts index 84cdba7..28af3ba 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -67,6 +67,7 @@ export interface Column { onClick?: ( data: {row: T; index: number; footer?: boolean; headerData?: boolean}, column: Column, + event: React.MouseEvent, ) => void; sortable?: boolean;