add header disabled to row markers#981
Conversation
9d0fefc to
3875ab0
Compare
|
|
||
| const [hCol, hRow] = hoveredItem ?? []; | ||
| const headerHovered = hCol !== undefined && hRow === -1; | ||
| const headerHovered = hCol !== undefined && hRow === -1 && columns[hCol].headerRowMarkerDisabled !== true; |
There was a problem hiding this comment.
Is it even to add this here? I think the current implementation of headerRowMarkerDisabled already prevents the row marker hover (but haven't verified this).
There was a problem hiding this comment.
headerRowMarkerDisabled hides the row marker checkbox, but the header cell still receives hover styles, shows a pointer cursor, and triggers select-all behavior on click.
| } | ||
| const selected = selection.columns.hasIndex(c.sourceIndex); | ||
| const noHover = dragAndDropState !== undefined || isResizing; | ||
| const noHover = dragAndDropState !== undefined || isResizing || c.headerRowMarkerDisabled === true; |
There was a problem hiding this comment.
Same as the comment above. Not sure if this is event required since the exising logic of headerRowMarkerDisabled should already prevent the hover checkbox.
There was a problem hiding this comment.
Only hides but doesn't prevent interaction; see comment above.
There was a problem hiding this comment.
Pull Request Overview
This pull request adds a new flag to disable header interactions for row markers, addressing issue #940. The changes update the header rendering logic, adjust hover behavior in the DataGrid component, and expose a new "headerDisabled" property in both the DataEditor and story examples.
- Updated data-grid-render to check the headerDisabled flag during header rendering.
- Modified DataGrid hover logic to respect the headerDisabled setting.
- Enhanced DataEditor and its story configuration to support header disabling.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/core/src/internal/data-grid/render/data-grid-render.header.ts | Updated header drawing logic to skip hover effects when header markers are disabled. |
| packages/core/src/internal/data-grid/data-grid.tsx | Modified headerHovered condition to consider headerDisabled flags. |
| packages/core/src/docs/examples/row-markers.stories.tsx | Added headerDisabled property to story args and interface. |
| packages/core/src/data-editor/data-editor.tsx | Updated row marker logic to incorporate the headerDisabled flag in determining header marker interactivity. |
Comments suppressed due to low confidence (1)
packages/core/src/internal/data-grid/render/data-grid-render.header.ts:80
- [nitpick] Add an inline comment to explain the purpose of the check for 'c.headerRowMarkerDisabled === true' to aid future maintainers in understanding the header hover logic.
const noHover = dragAndDropState !== undefined || isResizing || c.headerRowMarkerDisabled === true;
Closes #940