Tree: fix keyboard event

pull/8283/head
Leopoldthecoder 2017-11-15 11:03:02 +08:00 committed by 杨奕
parent 37f4ce0b30
commit 2884984097
1 changed files with 2 additions and 2 deletions

View File

@ -198,6 +198,8 @@
},
handelKeydown(ev) {
const currentItem = ev.target;
if (currentItem.className.indexOf('el-tree-node') === -1) return;
ev.preventDefault();
const keyCode = ev.keyCode;
this.treeItems = this.$el.querySelectorAll('.is-focusable[role=treeitem]');
const currentIndex = this.treeItemArray.indexOf(currentItem);
@ -218,8 +220,6 @@
if (hasInput) {
hasInput.click();
}
ev.stopPropagation();
ev.preventDefault();
}
}
},