Skip to content

Commit

Permalink
Add checks for clicking selector columns
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Beceic authored and jtomic-croz committed Feb 13, 2024
1 parent b7eb05d commit 179de91
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions libs/data-display/src/DataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -682,10 +682,15 @@ function DataTable<T extends object>({
)}
>
{primaryCells.map((cell, cellKey) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const colSpan = cell.column.colSpan;
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const align = cell.column.align;
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const isSelector = cell.column.id === "selector";
return (
<td
key={cellKey}
Expand All @@ -698,8 +703,10 @@ function DataTable<T extends object>({
)}
{...cell.getCellProps()}
colSpan={colSpan}
onClick={() => (onClick ? onClick(row.original) : undefined)}
onDoubleClick={() => (onDoubleClick ? onDoubleClick(row.original) : undefined)}
onClick={() => (onClick && !isSelector ? onClick(row.original) : undefined)}
onDoubleClick={() =>
onDoubleClick && !isSelector ? onDoubleClick(row.original) : undefined
}
>
{cell.render("Cell")}
</td>
Expand Down

0 comments on commit 179de91

Please sign in to comment.