From df7889447cf6584034e79960191e42c844be596e Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Thu, 1 Aug 2024 14:14:49 +0300 Subject: [PATCH] Fixed #6159 --- packages/primevue/src/tree/TreeNode.vue | 6 ++++-- packages/primevue/src/treenode/TreeNode.d.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/primevue/src/tree/TreeNode.vue b/packages/primevue/src/tree/TreeNode.vue index 4aec247d5..bab3a1748 100755 --- a/packages/primevue/src/tree/TreeNode.vue +++ b/packages/primevue/src/tree/TreeNode.vue @@ -143,7 +143,9 @@ export default { } if (this.isCheckboxSelectionMode()) { - this.toggleCheckbox(); + if (this.node.selectable != false) { + this.toggleCheckbox(); + } } else { this.$emit('node-click', { originalEvent: event, @@ -337,7 +339,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) { diff --git a/packages/primevue/src/treenode/TreeNode.d.ts b/packages/primevue/src/treenode/TreeNode.d.ts index d0827ddac..f4bc501db 100644 --- a/packages/primevue/src/treenode/TreeNode.d.ts +++ b/packages/primevue/src/treenode/TreeNode.d.ts @@ -44,7 +44,7 @@ export interface TreeNode { styleClass?: string; /** * Whether the node is selectable when selection mode is enabled. - * @defaultValue false + * @defaultValue null */ selectable?: boolean; /**