From 9fca0078c4c641ec6b4c004fd733761c8cc18f66 Mon Sep 17 00:00:00 2001 From: Benji Date: Tue, 18 Jun 2024 12:00:21 +0100 Subject: [PATCH] fix: TreeNode selectable not being used when in checkbox selectionMode If node selectable is false then clicking the node shouldn't add the node to selectedKeys. added selectable != false because selectable can be null | undefined | true to show the checkbox. --- components/lib/tree/TreeNode.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/lib/tree/TreeNode.vue b/components/lib/tree/TreeNode.vue index 2aaeccb73..0196d403f 100755 --- a/components/lib/tree/TreeNode.vue +++ b/components/lib/tree/TreeNode.vue @@ -142,7 +142,9 @@ export default { } if (this.isCheckboxSelectionMode()) { - this.toggleCheckbox(); + if (this.node.selectable != false) { + this.toggleCheckbox(); + } } else { this.$emit('node-click', { originalEvent: event, @@ -336,7 +338,7 @@ export default { }); }, propagateDown(node, check, selectionKeys) { - if (check) selectionKeys[node.key] = { checked: true, partialChecked: false }; + if (check && node.selectable != false) selectionKeys[node.key] = { checked: true, partialChecked: false }; else delete selectionKeys[node.key]; if (node.children && node.children.length) {