From f263c1aa85f97e9922d61ef4afb119da1b6db182 Mon Sep 17 00:00:00 2001 From: cagataycivici Date: Mon, 5 Aug 2019 11:01:19 +0300 Subject: [PATCH] Fixed metakey selection --- src/components/tree/Tree.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/tree/Tree.vue b/src/components/tree/Tree.vue index d97d06bcb..73ab48438 100644 --- a/src/components/tree/Tree.vue +++ b/src/components/tree/Tree.vue @@ -117,7 +117,7 @@ export default { const originalEvent = event.originalEvent; const node = event.node; const metaKey = (originalEvent.metaKey||originalEvent.ctrlKey); - const selected = this.selected; + const selected = this.isNodeSelected(node); let _selectionKeys; if (selected && metaKey) { @@ -147,7 +147,7 @@ export default { }, handleSelectionWithoutMetaKey(event) { const node = event.node; - const selected = this.isSelected(node); + const selected = this.isNodeSelected(node); let _selectionKeys; if (this.isSingleSelectionMode()) { @@ -184,7 +184,7 @@ export default { isMultipleSelectionMode() { return this.selectionMode === 'multiple'; }, - isSelected(node) { + isNodeSelected(node) { return (this.selectionMode && this.selectionKeys) ? this.selectionKeys[node.key] === true : false; }, isChecked(node) { @@ -336,6 +336,7 @@ export default { display: inline-block; padding: 0 .25em; vertical-align: middle; + user-select: none; } .p-tree .p-treenode.p-treenode-leaf > .p-treenode-content > .p-tree-toggler {