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.
pull/5914/head
Benji 2024-06-18 12:00:21 +01:00
parent 53e6246625
commit 9fca0078c4
1 changed files with 4 additions and 2 deletions

View File

@ -142,7 +142,9 @@ export default {
} }
if (this.isCheckboxSelectionMode()) { if (this.isCheckboxSelectionMode()) {
if (this.node.selectable != false) {
this.toggleCheckbox(); this.toggleCheckbox();
}
} else { } else {
this.$emit('node-click', { this.$emit('node-click', {
originalEvent: event, originalEvent: event,
@ -336,7 +338,7 @@ export default {
}); });
}, },
propagateDown(node, check, selectionKeys) { 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]; else delete selectionKeys[node.key];
if (node.children && node.children.length) { if (node.children && node.children.length) {