mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-01 11:39:28 +08:00
remove indexForSort (#2501) until another stable sort problem is reported
This commit is contained in:
parent
47a3b04eb1
commit
37c3de6b83
@ -254,11 +254,11 @@ export default class Table extends React.Component {
|
||||
return;
|
||||
}
|
||||
return (a, b) => {
|
||||
let result = sortColumn.sorter(a, b);
|
||||
const result = sortColumn.sorter(a, b);
|
||||
if (result !== 0) {
|
||||
return (sortOrder === 'descend') ? -result : result;
|
||||
}
|
||||
return a.indexForSort - b.indexForSort;
|
||||
return 0;
|
||||
};
|
||||
}
|
||||
|
||||
@ -722,9 +722,6 @@ export default class Table extends React.Component {
|
||||
let data = this.props.dataSource || [];
|
||||
// 优化本地排序
|
||||
data = data.slice(0);
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
data[i] = { ...data[i], indexForSort: i };
|
||||
}
|
||||
const sorterFn = this.getSorterFn();
|
||||
if (sorterFn) {
|
||||
data = data.sort(sorterFn);
|
||||
|
Loading…
Reference in New Issue
Block a user