From 324f18aa4166476568824482a7117ac2a45eebe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20G=C3=BCell=20Segarra?= Date: Fri, 15 Nov 2024 11:17:35 +0100 Subject: [PATCH] fix: do not show pointer if no row click (#28) * fix: do not show pointer cursor if we don't have callback https://github.com/gisce/webclient/issues/1368 * fix: adjustments in showPointerCursorInRows * fix: adjustments in showPointerCursorInRows https://github.com/gisce/webclient/issues/1368 --- src/components/InfiniteTable/InfiniteTable.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/InfiniteTable/InfiniteTable.tsx b/src/components/InfiniteTable/InfiniteTable.tsx index 040676a..b32062c 100644 --- a/src/components/InfiniteTable/InfiniteTable.tsx +++ b/src/components/InfiniteTable/InfiniteTable.tsx @@ -61,6 +61,7 @@ export type InfiniteTableProps = Omit< onRowStatus?: (item: any) => any; statusComponent?: (status: any) => ReactNode; strings?: Record; + showPointerCursorInRows?: boolean; }; export type InfiniteTableRef = { @@ -91,6 +92,7 @@ const InfiniteTableComp = forwardRef( statusComponent, hasStatusColumn = false, strings = {}, + showPointerCursorInRows = true, } = props; const gridRef = useRef(null); @@ -478,9 +480,9 @@ const InfiniteTableComp = forwardRef( const rowStyle = useMemo(() => { return { - cursor: "pointer", + cursor: showPointerCursorInRows ? "pointer" : "default", }; - }, []); + }, [showPointerCursorInRows]); return (