fix(解决阻止默认Tab键事件):

This commit is contained in:
wanghaoo 2018-12-25 09:33:01 +08:00
parent 27cf462d1d
commit 3bec289114
3 changed files with 5 additions and 5 deletions

View File

@ -513,7 +513,7 @@ var Tree = function (_React$Component) {
Tree.prototype.onKeyDown = function onKeyDown(e, treeNode) {
event.preventDefault();
// event.preventDefault()
// console.log('-----'+e.keyCode);
var props = this.props;
var currentPos = treeNode.props.pos;
@ -526,10 +526,10 @@ var Tree = function (_React$Component) {
} else if (e.keyCode == _tinperBeeCore.KeyCode.LEFT) {
// 收起树节点
this.onExpand(treeNode, 'left');
} else if (e.keyCode == _tinperBeeCore.KeyCode.RIGHT) {
} 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 && props.checkable && !treeNode.props.isLeaf) {
// 如果是多选tree则进行选中或者反选该节点
this.onCheck(treeNode);
}

View File

@ -196,7 +196,7 @@ var TreeNode = function (_React$Component) {
TreeNode.prototype.onKeyDown = function onKeyDown(e) {
this.props.root.onKeyDown(e, this);
e.preventDefault();
// e.preventDefault();
};
TreeNode.prototype.renderSwitcher = function renderSwitcher(props, expandedState) {

View File

@ -1,6 +1,6 @@
{
"name": "bee-tree",
"version": "1.1.7",
"version": "1.1.8",
"description": "Tree ui component for react",
"keywords": [
"react",