@@ -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