Skip to content

Commit aa6da95

Browse files
authored
fix: subrow reset sorting (fix #5103) (#5112)
* Sorting subrows unintentionally updates CoreRowModel subrows. Do a deeper copy when beginning to sort instead.
1 parent a7e7aa0 commit aa6da95

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/table-core/src/utils/getSortedRowModel.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export function getSortedRowModel<TData extends RowData>(): (
4545
const sortData = (rows: Row<TData>[]) => {
4646
// This will also perform a stable sorting using the row index
4747
// if needed.
48-
const sortedData = [...rows]
48+
const sortedData = rows.map(row => ({...row}))
4949

5050
sortedData.sort((rowA, rowB) => {
5151
for (let i = 0; i < availableSorting.length; i += 1) {

0 commit comments

Comments
 (0)