Commit 28849840 authored by Leopoldthecoder's avatar Leopoldthecoder Committed by 杨奕

Tree: fix keyboard event

parent 37f4ce0b
...@@ -198,6 +198,8 @@ ...@@ -198,6 +198,8 @@
}, },
handelKeydown(ev) { handelKeydown(ev) {
const currentItem = ev.target; const currentItem = ev.target;
if (currentItem.className.indexOf('el-tree-node') === -1) return;
ev.preventDefault();
const keyCode = ev.keyCode; const keyCode = ev.keyCode;
this.treeItems = this.$el.querySelectorAll('.is-focusable[role=treeitem]'); this.treeItems = this.$el.querySelectorAll('.is-focusable[role=treeitem]');
const currentIndex = this.treeItemArray.indexOf(currentItem); const currentIndex = this.treeItemArray.indexOf(currentItem);
...@@ -218,8 +220,6 @@ ...@@ -218,8 +220,6 @@
if (hasInput) { if (hasInput) {
hasInput.click(); hasInput.click();
} }
ev.stopPropagation();
ev.preventDefault();
} }
} }
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment