material-react-table 1.0.10 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.10",
2
+ "version": "1.0.11",
3
3
  "license": "MIT",
4
4
  "name": "material-react-table",
5
5
  "description": "A fully featured Material UI V5 implementation of TanStack React Table V8, written from the ground up in TypeScript.",
@@ -10,21 +10,26 @@ interface Props {
10
10
  export const MRT_TableHead: FC<Props> = ({ table }) => {
11
11
  const {
12
12
  getHeaderGroups,
13
- options: { enableStickyHeader, muiTableHeadProps },
13
+ getState,
14
+ options: { enableStickyHeader, muiTableHeadProps, enableRowVirtualization },
14
15
  } = table;
16
+ const { isFullScreen } = getState();
15
17
 
16
18
  const tableHeadProps =
17
19
  muiTableHeadProps instanceof Function
18
20
  ? muiTableHeadProps({ table })
19
21
  : muiTableHeadProps;
20
22
 
23
+ const stickyHeader =
24
+ enableStickyHeader || enableRowVirtualization || isFullScreen;
25
+
21
26
  return (
22
27
  <TableHead
23
28
  {...tableHeadProps}
24
29
  sx={(theme) => ({
25
30
  opacity: 0.97,
26
- position: enableStickyHeader ? 'sticky' : undefined,
27
- zIndex: enableStickyHeader ? 2 : undefined,
31
+ position: stickyHeader ? 'sticky' : undefined,
32
+ zIndex: stickyHeader ? 2 : undefined,
28
33
  ...(tableHeadProps?.sx instanceof Function
29
34
  ? tableHeadProps?.sx(theme)
30
35
  : (tableHeadProps?.sx as any)),