Skip to content

Commit 3875ab0

Browse files
committed
add header disabled to row markers
1 parent 5983dca commit 3875ab0

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

packages/core/src/data-editor/data-editor.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ export interface RowMarkerOptions {
101101
theme?: Partial<Theme>;
102102
headerTheme?: Partial<Theme>;
103103
headerAlwaysVisible?: boolean;
104+
headerDisabled?: boolean;
104105
}
105106

106107
interface MouseState {
@@ -877,7 +878,7 @@ const DataEditorImpl: React.ForwardRefRenderFunction<DataEditorRef, DataEditorPr
877878
const rowMarkerTheme = rowMarkersObj?.theme ?? p.rowMarkerTheme;
878879
const headerRowMarkerTheme = rowMarkersObj?.headerTheme;
879880
const headerRowMarkerAlwaysVisible = rowMarkersObj?.headerAlwaysVisible;
880-
const headerRowMarkerDisabled = rowSelect !== "multi";
881+
const headerRowMarkerDisabled = rowSelect !== "multi" || rowMarkersObj?.headerDisabled === true;
881882
const rowMarkerCheckboxStyle = rowMarkersObj?.checkboxStyle ?? "square";
882883

883884
const minColumnWidth = Math.max(minColumnWidthIn, 20);
@@ -1899,7 +1900,7 @@ const DataEditorImpl: React.ForwardRefRenderFunction<DataEditorRef, DataEditorPr
18991900
if (hasRowMarkers && col === 0) {
19001901
lastSelectedRowRef.current = undefined;
19011902
lastSelectedColRef.current = undefined;
1902-
if (rowSelect === "multi") {
1903+
if (!headerRowMarkerDisabled && rowSelect === "multi") {
19031904
if (selectedRows.length !== rows) {
19041905
setSelectedRows(CompactSelection.fromSingleSelection([0, rows]), undefined, isMultiKey);
19051906
} else {

packages/core/src/internal/data-grid/render/data-grid-render.header.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export function drawGridHeaders(
7777
ctx.font = theme.baseFontFull;
7878
}
7979
const selected = selection.columns.hasIndex(c.sourceIndex);
80-
const noHover = dragAndDropState !== undefined || isResizing;
80+
const noHover = dragAndDropState !== undefined || isResizing || c.headerRowMarkerDisabled === true;
8181
const hoveredBoolean = !noHover && hRow === -1 && hCol === c.sourceIndex;
8282
const hover = noHover
8383
? 0

setup-react-18-test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
npm i -D react@latest react-dom@latest @testing-library/react@latest @testing-library/react-hooks@latest @testing-library/[email protected] react-test-renderer@latest
3+
npm i -D react@latest react-dom@latest @testing-library/react@latest @testing-library/react-hooks@latest @testing-library/[email protected] react-test-renderer@latest @testing-library/dom

0 commit comments

Comments
 (0)