Skip to content

Commit

Permalink
[DataGrid] Restore main slot (#12657)
Browse files Browse the repository at this point in the history
  • Loading branch information
romgrk authored Apr 4, 2024
1 parent d533964 commit 771a287
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import * as React from 'react';
import { styled } from '@mui/system';
import { DataGridProcessedProps } from '../../models/props/DataGridProps';
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
import { useGridAriaAttributes } from '../../hooks/utils/useGridAriaAttributes';

const Element = styled('div')({
type OwnerState = DataGridProcessedProps;

const Element = styled('div', {
name: 'MuiDataGrid',
slot: 'Main',
overridesResolver: (props, styles) => styles.main,
})<{ ownerState: OwnerState }>({
flexGrow: 1,
position: 'relative',
overflow: 'hidden',
Expand All @@ -15,9 +23,16 @@ export const GridMainContainer = React.forwardRef<
}>
>((props, ref) => {
const ariaAttributes = useGridAriaAttributes();
const rootProps = useGridRootProps();

return (
<Element ref={ref} className={props.className} tabIndex={-1} {...ariaAttributes}>
<Element
ref={ref}
ownerState={rootProps}
className={props.className}
tabIndex={-1}
{...ariaAttributes}
>
{props.children}
</Element>
);
Expand Down

0 comments on commit 771a287

Please sign in to comment.