Skip to content

Commit

Permalink
clear selected item when change dataSource, #793, bump 0.10.5
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Jan 4, 2016
1 parent cad92a5 commit f754c2f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

---

## 0.10.5 `2016-01-04`

- 修复 Table 更新 dataSource 后,选中项没有置空的问题。[#793](https://github.com/ant-design/ant-design/issues/793)

## 0.10.4 `2015-11-30`

- 将 media-match 加入默认的 polyfil 文件中。[5626974](https://github.com/ant-design/ant-design/commit/562697423b1139eb324c1dceb051c143f4870ed7)
Expand Down
9 changes: 1 addition & 8 deletions components/table/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,8 @@ let AntTable = React.createClass({
// 外界只有 dataSource 的变化会触发新请求
if ('dataSource' in nextProps &&
nextProps.dataSource !== this.props.dataSource) {
let selectedRowKeys = this.state.selectedRowKeys;
// 把不在当前页的选中项去掉
if (this.isLocalDataSource()) {
let currentPageRowKeys = this.getLocalDataPaging(nextProps.dataSource);
selectedRowKeys = selectedRowKeys.filter((key) => {
return currentPageRowKeys.indexOf(key) >= 0;
});
}
this.setState({
selectedRowKeys: [],
selectionDirty: false,
dataSource: nextProps.dataSource,
loading: true
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "antd",
"version": "0.10.4",
"stableVersion": "0.10.4",
"version": "0.10.5",
"stableVersion": "0.10.5",
"title": "Ant Design",
"description": "一个 UI 设计语言",
"homepage": "http://ant.design/",
Expand Down

0 comments on commit f754c2f

Please sign in to comment.