Skip to content

Commit

Permalink
fix(Tree): can`t pos of undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
myronliu347 committed Jun 19, 2019
1 parent b534738 commit 9b0ff2c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/tree/view/tree.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -488,12 +488,15 @@ export default class Tree extends Component {
}

getCheckedKeys(props, willReceiveProps) {
let checkedKeys =
'checkedKeys' in props
? props.checkedKeys
: willReceiveProps
? []
: props.defaultCheckedKeys;
let checkedKeys = props.defaultCheckedKeys;

if ('checkedKeys' in props) {
checkedKeys = props.checkedKeys;
} else if (willReceiveProps) {
checkedKeys = [];
}

checkedKeys = checkedKeys.filter(key => !!this._k2n[key]);

const { checkStrictly } = this.props;
if (checkStrictly) {
Expand Down

0 comments on commit 9b0ff2c

Please sign in to comment.