Skip to content

Commit 99e28d1

Browse files
authored
fix(TableStateful): Prevent in-place sorting in TableStateful to restore initial sort on NOS (#7715)
2 parents 5298ad7 + 54d444e commit 99e28d1

File tree

1 file changed

+2
-2
lines changed
  • packages/components/src/components/table-stateful

1 file changed

+2
-2
lines changed

packages/components/src/components/table-stateful/shadow.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,9 @@ export class KolTableStateful implements TableAPI {
410410
return;
411411
}
412412

413-
let sortedData: KoliBriTableDataType[] = this.state._data;
413+
const sortedData: KoliBriTableDataType[] = [...this.state._data];
414414
if (this.sortData.length > 0) {
415-
sortedData = this.state._data.sort((a: KoliBriTableDataType, b: KoliBriTableDataType) => {
415+
sortedData.sort((a: KoliBriTableDataType, b: KoliBriTableDataType) => {
416416
for (let index = 0; index < this.sortData.length; index++) {
417417
const data = this.sortData[index];
418418
const result = data.compareFn(a, b);

0 commit comments

Comments
 (0)