不带复选框的树,不能通过空格键选中树节点的问题
This commit is contained in:
parent
5e4a17cadc
commit
03e4dbf620
|
@ -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);
|
||||
}
|
||||
|
|
168
demo/index.js
168
demo/index.js
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue