Skip to content

Commit eeebe11

Browse files
[DataGrid] Fix prop-type warning with v5
1 parent 6e06fc8 commit eeebe11

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/grid/_modules_/grid/components/panel/GridPanelWrapper.tsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as React from 'react';
22
import clsx from 'clsx';
33
import TrapFocus from '@material-ui/core/Unstable_TrapFocus';
44
import { makeStyles } from '@material-ui/styles';
5+
import { getMuiVersion } from './utils';
56

67
const useStyles = makeStyles(
78
() => ({
@@ -24,8 +25,14 @@ export function GridPanelWrapper(
2425
) {
2526
const classes = useStyles();
2627
const { className, ...other } = props;
28+
const extraProps = getMuiVersion().startsWith('v4')
29+
? {
30+
getDoc: () => document,
31+
}
32+
: {} as any;
33+
2734
return (
28-
<TrapFocus open disableEnforceFocus isEnabled={isEnabled} getDoc={() => document}>
35+
<TrapFocus open disableEnforceFocus isEnabled={isEnabled} {...extraProps}>
2936
<div tabIndex={-1} className={clsx(classes.root, className)} {...other} />
3037
</TrapFocus>
3138
);

0 commit comments

Comments
 (0)