From 37c3de6b83e94cff0652473cdcee6eec9167f794 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 23 Aug 2016 18:00:01 +0800 Subject: [PATCH] remove indexForSort (#2501) until another stable sort problem is reported --- components/table/Table.jsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/components/table/Table.jsx b/components/table/Table.jsx index 137fbd1113..fdd7a35d5a 100644 --- a/components/table/Table.jsx +++ b/components/table/Table.jsx @@ -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);