fix: selectable为 false 时,回车不选中节点

This commit is contained in:
yangchch6 2020-04-19 15:18:00 +08:00
parent 8db7c124b3
commit c8f3a8ddca
4 changed files with 7 additions and 4 deletions

View File

@ -718,6 +718,7 @@ var Tree = function (_React$Component) {
var props = this.props;
var currentPos = treeNode.props.pos;
var selectable = treeNode.props.selectable;
var currentIndex = currentPos.substr(currentPos.lastIndexOf('-') + 1);
//向下键down
if (e.keyCode == _tinperBeeCore.KeyCode.DOWN) {
@ -738,7 +739,7 @@ var Tree = function (_React$Component) {
if (props.onDoubleClick) {
this.onDoubleClick(treeNode);
} else {
this.onSelect(treeNode);
selectable && this.onSelect(treeNode);
props.checkable && this.onCheck(treeNode);
}
}

3
dist/demo.js vendored
View File

@ -35000,6 +35000,7 @@
var props = this.props;
var currentPos = treeNode.props.pos;
var selectable = treeNode.props.selectable;
var currentIndex = currentPos.substr(currentPos.lastIndexOf('-') + 1);
//向下键down
if (e.keyCode == _tinperBeeCore.KeyCode.DOWN) {
@ -35020,7 +35021,7 @@
if (props.onDoubleClick) {
this.onDoubleClick(treeNode);
} else {
this.onSelect(treeNode);
selectable && this.onSelect(treeNode);
props.checkable && this.onCheck(treeNode);
}
}

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -660,6 +660,7 @@ onExpand(treeNode,keyType) {
const props = this.props;
const currentPos = treeNode.props.pos;
const selectable = treeNode.props.selectable;
const currentIndex = currentPos.substr(currentPos.lastIndexOf('-')+1);
//向下键down
if(e.keyCode == KeyCode.DOWN){
@ -680,7 +681,7 @@ onExpand(treeNode,keyType) {
if(props.onDoubleClick) {
this.onDoubleClick(treeNode);
} else {
this.onSelect(treeNode);
selectable && this.onSelect(treeNode);
props.checkable && this.onCheck(treeNode);
}
}