Skip to content

Commit

Permalink
temp(Tree): onSelect add event prop
Browse files Browse the repository at this point in the history
  • Loading branch information
myronliu347 committed Jul 4, 2019
1 parent 8796abe commit 15c6e37
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/tree/view/tree-node.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export default class TreeNode extends Component {
e.preventDefault();

const { root, selected, eventKey } = this.props;
root.handleSelect(!selected, eventKey, this);
root.handleSelect(!selected, eventKey, this, e);
}

handleCheck() {
Expand Down
5 changes: 3 additions & 2 deletions src/tree/view/tree.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ export default class Tree extends Component {
if (checkable) {
this.handleCheck(!item.props.checked, key, node);
} else if (selectable) {
this.handleSelect(!item.props.selected, key, node);
this.handleSelect(!item.props.selected, key, node, e);
}
break;
}
Expand Down Expand Up @@ -650,7 +650,7 @@ export default class Tree extends Component {
}
}

handleSelect(select, key, node) {
handleSelect(select, key, node, e) {
const { multiple, onSelect } = this.props;
let selectedKeys = [...this.state.selectedKeys];
if (multiple) {
Expand All @@ -668,6 +668,7 @@ export default class Tree extends Component {
selectedNodes: this.getNodes(selectedKeys),
node,
selected: select,
event: e,
});
}

Expand Down

0 comments on commit 15c6e37

Please sign in to comment.