Skip to content
This repository was archived by the owner on Mar 9, 2025. It is now read-only.

Commit 5c375bc

Browse files
committed
fix: sort by index initially and then set the correct value
1 parent 50d63a7 commit 5c375bc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/data/serialize-table-state.ts

+4
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,10 @@ export const deserializeTableState = (data: string): TableState => {
352352
typedColumn.sortDir = SortDir.NONE;
353353
});
354354

355+
//Sort by index
356+
bodyRows.sort((a, b) => a.index - b.index);
357+
358+
//Set the index to the correct value
355359
bodyRows.forEach((row: unknown, i) => {
356360
const typedRow = row as Record<string, unknown>;
357361
typedRow.index = i;

0 commit comments

Comments
 (0)