Skip to content

Commit 32c33b5

Browse files
authored
Update the order of operations for pagination example so that slicing takes place after sorting. (mui#34189)
Signed-off-by: Marceli Wac <[email protected]>
1 parent 8a584fd commit 32c33b5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/data/material/components/tables/EnhancedTable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ export default function EnhancedTable() {
304304
/>
305305
<TableBody>
306306
{/* if you don't need to support IE11, you can replace the `stableSort` call with:
307-
rows.slice().sort(getComparator(order, orderBy)) */}
307+
rows.sort(getComparator(order, orderBy)).slice() */}
308308
{stableSort(rows, getComparator(order, orderBy))
309309
.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
310310
.map((row, index) => {

docs/data/material/components/tables/EnhancedTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ export default function EnhancedTable() {
335335
/>
336336
<TableBody>
337337
{/* if you don't need to support IE11, you can replace the `stableSort` call with:
338-
rows.slice().sort(getComparator(order, orderBy)) */}
338+
rows.sort(getComparator(order, orderBy)).slice() */}
339339
{stableSort(rows, getComparator(order, orderBy))
340340
.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
341341
.map((row, index) => {

0 commit comments

Comments
 (0)