-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DataGridPro] Render pinned and non-pinned column headers in one row #12376
[DataGridPro] Render pinned and non-pinned column headers in one row #12376
Conversation
Deploy preview: https://deploy-preview-12376--material-ui-x.netlify.app/ Updated pages: |
This comment was marked as outdated.
This comment was marked as outdated.
@@ -533,7 +522,7 @@ const GridRow = React.forwardRef<HTMLDivElement, GridRowProps>(function GridRow( | |||
/> | |||
{cells} | |||
{emptyCellWidth > 0 && <EmptyCell width={emptyCellWidth} />} | |||
{rightCells.length > 0 && <div role="presentation" style={{ flex: '1' }} />} | |||
{rightCells.length > 0 && <div role="presentation" className={gridClasses.filler} />} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved inline styles to GridRootStyles since the filler is rendered for every row
@@ -77,10 +77,6 @@ export interface GridCorePrivateApi< | |||
* The React ref of the grid column container virtualized div element. | |||
*/ | |||
columnHeadersContainerElementRef?: React.RefObject<HTMLDivElement>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could refactor this one to columnHeadersContainerRef
, long names aren't great for readability.
import { gridColumnsTotalWidthSelector } from '../hooks/features/columns/gridColumnsSelector'; | ||
import { GridScrollParams } from '../models/params/gridScrollParams'; | ||
import { GridEventListener } from '../models/events'; | ||
import { useTimeout } from '../hooks/utils/useTimeout'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have it in @mui/utils/useTimeout
now I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, also for the useLazyRef
and useOnMount
hooks.
Plus, did the same in @mui/x-tree-view
@@ -1024,12 +1024,6 @@ | |||
"description": "Styles applied to the selection checkbox element.", | |||
"isGlobal": false | |||
}, | |||
{ | |||
"key": "columnGroupHeader", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't used in the codebase
docs/data/migration/migration-data-grid-v6/migration-data-grid-v6.md
Outdated
Show resolved
Hide resolved
…-v6.md Signed-off-by: Andrew Cherniavskii <[email protected]>
Closes #11949
TODO:
Changelog
Breaking changes
columnHeader--showColumnBorder
class was replaced bycolumnHeader--withLeftBorder
andcolumnHeader--withRightBorder
.columnHeadersInner
,columnHeadersInner--scrollable
, andcolumnHeaderDropZone
classes were removed since the inner wrapper was removed in our effort to simplify the DOM structure and improve accessibility.pinnedColumnHeaders
,pinnedColumnHeaders--left
, andpinnedColumnHeaders--right
classes were removed along with the element they were applied to.The pinned column headers now use
position: 'sticky'
and are rendered in the same row element as the regular column headers.