提交 f754c2f9 编写于 作者: A afc163

clear selected item when change dataSource, #793, bump 0.10.5

上级 cad92a5b
......@@ -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)
......
......@@ -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
......
{
"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/",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册