mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 11:10:01 +08:00
selectedRows should match selectedRowKeys, close #2566
This commit is contained in:
parent
2536dbee78
commit
9726122904
@ -105,7 +105,7 @@ export default class Table extends React.Component {
|
||||
if (!rowSelection.getCheckboxProps) {
|
||||
return [];
|
||||
}
|
||||
return this.getFlatCurrentPageData()
|
||||
return this.getFlatData()
|
||||
.filter(item => this.getCheckboxPropsByItem(item).defaultChecked)
|
||||
.map((record, rowIndex) => this.getRecordKey(record, rowIndex));
|
||||
}
|
||||
@ -177,7 +177,7 @@ export default class Table extends React.Component {
|
||||
if (rowSelection && !('selectedRowKeys' in rowSelection)) {
|
||||
this.setState({ selectedRowKeys });
|
||||
}
|
||||
const data = this.getFlatCurrentPageData();
|
||||
const data = this.getFlatData();
|
||||
if (!rowSelection.onChange && !rowSelection[selectWay]) {
|
||||
return;
|
||||
}
|
||||
@ -709,6 +709,10 @@ export default class Table extends React.Component {
|
||||
return data;
|
||||
}
|
||||
|
||||
getFlatData() {
|
||||
return flatArray(this.getLocalData());
|
||||
}
|
||||
|
||||
getFlatCurrentPageData() {
|
||||
return flatArray(this.getCurrentPageData());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user