Skip to content

Commit

Permalink
Add pointer cursor when onRowClick is set
Browse files Browse the repository at this point in the history
  • Loading branch information
jpfisher72 committed Nov 21, 2023
1 parent 320fd11 commit 0a855f1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@weng-lab/psychscreen-ui-components",
"description": "Typescript and Material UI based components used for psychSCREEN",
"author": "SCREEN Team @ UMass Chan Medical School",
"version": "0.8.0-a.2",
"version": "0.8.0-a.3",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down
2 changes: 2 additions & 0 deletions src/components/DataTable/datatable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ const DataTable: React.FC<DataTableProps<any>> = (props: DataTableProps<any>) =>
hover
key={"row" + i}
onClick={() => props.onRowClick && props.onRowClick(row, i + page * rowsPerPage)}
sx={{cursor: props.onRowClick ? "pointer" : "auto"}}
onMouseEnter={() => props.onRowMouseEnter && props.onRowMouseEnter(row, i + page * rowsPerPage)}
onMouseLeave={() => props.onRowMouseLeave && props.onRowMouseLeave()}
>
Expand Down Expand Up @@ -382,6 +383,7 @@ const DataTable: React.FC<DataTableProps<any>> = (props: DataTableProps<any>) =>
<Typography variant="h4">Add Columns</Typography>
{(props.defaultColumnsToShow
? props.columns.filter((c) => !props.defaultColumnsToShow?.includes(c.header))
//Why is this "or 5" here? Kinda makes no sense?
: props.columns.slice(props.noOfDefaultColumns || 5, props.columns.length)
).map((col, i) => (
<Fragment key={i}>
Expand Down
2 changes: 1 addition & 1 deletion stories/DataTable.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ AddMoreColumnsOnSelect.args = {
tableTitle: "Table Title",
searchable: true,
showMoreColumns: true,
noOfDefaultColumns: 3
noOfDefaultColumns: 2
}

HoverInfo.args = {
Expand Down

0 comments on commit 0a855f1

Please sign in to comment.