From 3875ab06425ec2c15d1d1d02f2df69b20929a827 Mon Sep 17 00:00:00 2001 From: Brian Hung Date: Thu, 11 Jul 2024 23:31:17 -0700 Subject: [PATCH 1/2] add header disabled to row markers --- packages/core/src/data-editor/data-editor.tsx | 5 +++-- .../src/internal/data-grid/render/data-grid-render.header.ts | 2 +- setup-react-18-test.sh | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/core/src/data-editor/data-editor.tsx b/packages/core/src/data-editor/data-editor.tsx index 4736b1099..01165ffd2 100644 --- a/packages/core/src/data-editor/data-editor.tsx +++ b/packages/core/src/data-editor/data-editor.tsx @@ -101,6 +101,7 @@ export interface RowMarkerOptions { theme?: Partial; headerTheme?: Partial; headerAlwaysVisible?: boolean; + headerDisabled?: boolean; } interface MouseState { @@ -877,7 +878,7 @@ const DataEditorImpl: React.ForwardRefRenderFunction Date: Thu, 11 Jul 2024 23:47:31 -0700 Subject: [PATCH 2/2] disable pointer if row header disabled --- packages/core/src/internal/data-grid/data-grid.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/core/src/internal/data-grid/data-grid.tsx b/packages/core/src/internal/data-grid/data-grid.tsx index 52338a786..983820c4d 100644 --- a/packages/core/src/internal/data-grid/data-grid.tsx +++ b/packages/core/src/internal/data-grid/data-grid.tsx @@ -915,7 +915,7 @@ const DataGrid: React.ForwardRefRenderFunction = (p, const [overFill, setOverFill] = React.useState(false); const [hCol, hRow] = hoveredItem ?? []; - const headerHovered = hCol !== undefined && hRow === -1; + const headerHovered = hCol !== undefined && hRow === -1 && columns[hCol].headerRowMarkerDisabled !== true; const groupHeaderHovered = hCol !== undefined && hRow === -2; let clickableInnerCellHovered = false; let editableBoolHovered = false; @@ -940,6 +940,7 @@ const DataGrid: React.ForwardRefRenderFunction = (p, : headerHovered || clickableInnerCellHovered || editableBoolHovered || groupHeaderHovered ? "pointer" : "default"; + console.log("CURSOR", cursor, cursorOverride, headerHovered); const style = React.useMemo( () => ({ // width,