Skip to content

Commit 545bf47

Browse files
committed
release v2.4.1
1 parent 64dd481 commit 545bf47

File tree

3 files changed

+50
-33
lines changed

3 files changed

+50
-33
lines changed

apps/material-react-table-docs/pages/changelog.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ import Head from 'next/head';
1212

1313
### Version 2
1414

15+
#### Version 2.4.1 - 2024-01-05
16+
17+
- Fixed MUI Pagination disabled tooltip warning
18+
- Fixed Column Pinning Spacing with Column Virtualization
19+
- Fixed Column Action Clear Filter Item when filterFn was "empty" or "notEmpty"
20+
1521
#### Version 2.4.0 - 2024-01-04
1622

1723
- Upgraded to TanStack Table `v8.11.3` for bug fixes with expanding and row selection

packages/material-react-table/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "2.4.0",
2+
"version": "2.4.1",
33
"license": "MIT",
44
"name": "material-react-table",
55
"description": "A fully featured Material UI V5 implementation of TanStack React Table V8, written from the ground up in TypeScript.",

packages/material-react-table/src/toolbar/MRT_TablePagination.tsx

Lines changed: 43 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ export const MRT_TablePagination = <TData extends MRT_RowData>({
7272
..._rest
7373
} = paginationProps ?? {};
7474

75+
const disableBack = pageIndex <= 0 || disabled;
76+
const disableNext = lastRowIndex >= totalRowCount || disabled;
77+
7578
return (
7679
<Box
7780
className="MuiTablePagination-root"
@@ -166,47 +169,55 @@ export const MRT_TablePagination = <TData extends MRT_RowData>({
166169
} ${totalRowCount.toLocaleString()}`}</Typography>
167170
<Box gap="xs">
168171
{showFirstButton && (
169-
<Tooltip title={localization.goToFirstPage}>
172+
<Tooltip enterDelay={1000} title={localization.goToFirstPage}>
173+
<span>
174+
<IconButton
175+
aria-label={localization.goToFirstPage}
176+
disabled={disableBack}
177+
onClick={() => setPageIndex(0)}
178+
size="small"
179+
>
180+
<FirstPageIcon />
181+
</IconButton>
182+
</span>
183+
</Tooltip>
184+
)}
185+
<Tooltip enterDelay={1000} title={localization.goToPreviousPage}>
186+
<span>
170187
<IconButton
171-
aria-label={localization.goToFirstPage}
172-
disabled={pageIndex <= 0 || disabled}
173-
onClick={() => setPageIndex(0)}
188+
aria-label={localization.goToPreviousPage}
189+
disabled={disableBack}
190+
onClick={() => setPageIndex(pageIndex - 1)}
174191
size="small"
175192
>
176-
<FirstPageIcon />
193+
<ChevronLeftIcon />
177194
</IconButton>
178-
</Tooltip>
179-
)}
180-
<Tooltip title={localization.goToPreviousPage}>
181-
<IconButton
182-
aria-label={localization.goToPreviousPage}
183-
disabled={pageIndex <= 0 || disabled}
184-
onClick={() => setPageIndex(pageIndex - 1)}
185-
size="small"
186-
>
187-
<ChevronLeftIcon />
188-
</IconButton>
195+
</span>
189196
</Tooltip>
190-
<Tooltip title={localization.goToNextPage}>
191-
<IconButton
192-
aria-label={localization.goToNextPage}
193-
disabled={lastRowIndex >= totalRowCount || disabled}
194-
onClick={() => setPageIndex(pageIndex + 1)}
195-
size="small"
196-
>
197-
<ChevronRightIcon />
198-
</IconButton>
199-
</Tooltip>
200-
{showLastButton && (
201-
<Tooltip title={localization.goToLastPage}>
197+
<Tooltip enterDelay={1000} title={localization.goToNextPage}>
198+
<span>
202199
<IconButton
203-
aria-label={localization.goToLastPage}
204-
disabled={lastRowIndex >= totalRowCount || disabled}
205-
onClick={() => setPageIndex(numberOfPages - 1)}
200+
aria-label={localization.goToNextPage}
201+
disabled={disableNext}
202+
onClick={() => setPageIndex(pageIndex + 1)}
206203
size="small"
207204
>
208-
<LastPageIcon />
205+
<ChevronRightIcon />
209206
</IconButton>
207+
</span>
208+
</Tooltip>
209+
{showLastButton && (
210+
<Tooltip enterDelay={1000} title={localization.goToLastPage}>
211+
<span>
212+
<IconButton
213+
aria-label={localization.goToLastPage}
214+
disabled={disableNext}
215+
onClick={() => setPageIndex(numberOfPages - 1)}
216+
size="small"
217+
>
218+
<LastPageIcon />
219+
</IconButton>
220+
</span>
210221
</Tooltip>
211222
)}
212223
</Box>

0 commit comments

Comments
 (0)