不带复选框的树,不能通过空格键选中树节点的问题

This commit is contained in:
yangchch6 2019-08-10 11:38:50 +08:00
parent 5e4a17cadc
commit 03e4dbf620
6 changed files with 486 additions and 242 deletions

View File

@ -566,10 +566,10 @@ var Tree = function (_React$Component) {
} else if (e.keyCode == _tinperBeeCore.KeyCode.RIGHT && !treeNode.props.isLeaf) {
// 展开树节点
this.onExpand(treeNode, 'right');
} else if (e.keyCode == _tinperBeeCore.KeyCode.SPACE && props.checkable) {
} else if (e.keyCode == _tinperBeeCore.KeyCode.SPACE) {
this.onSelect(treeNode);
// 如果是多选tree则进行选中或者反选该节点
this.onCheck(treeNode);
props.checkable && this.onCheck(treeNode);
} else if (e.keyCode == _tinperBeeCore.KeyCode.ENTER) {
this.onDoubleClick(treeNode);
}

File diff suppressed because one or more lines are too long

2
dist/demo.css.map vendored

File diff suppressed because one or more lines are too long

548
dist/demo.js vendored

File diff suppressed because one or more lines are too long

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -540,10 +540,10 @@ onExpand(treeNode,keyType) {
}else if (e.keyCode == KeyCode.RIGHT && !treeNode.props.isLeaf){
// 展开树节点
this.onExpand(treeNode,'right');
}else if (e.keyCode == KeyCode.SPACE && props.checkable){
}else if (e.keyCode == KeyCode.SPACE){
this.onSelect(treeNode);
// 如果是多选tree则进行选中或者反选该节点
this.onCheck(treeNode);
props.checkable && this.onCheck(treeNode);
}else if(e.keyCode == KeyCode.ENTER){
this.onDoubleClick(treeNode);
}