From 0458d8994de370e9c920b623ef94da99e336874e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Esnault?= Date: Tue, 8 Oct 2024 15:18:52 +0200 Subject: [PATCH] toggle uncheckable branch --- docs/partials/guides.pug | 2 +- src/components/Option.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/partials/guides.pug b/docs/partials/guides.pug index 4900a20b..a6361e85 100644 --- a/docs/partials/guides.pug +++ b/docs/partials/guides.pug @@ -96,7 +96,7 @@ +subsection('Checkable Item Selection') :markdown-it - You can make item checkable by setting `isCheckable: true` on any leaf node or branch node. + You can make item checkable by setting `isCheckable: true` on any leaf node or branch node. Uncheckable branch nodes are treated as folders only. +demo('CheckableItemSelection') +subsection('Disable Item Selection') diff --git a/src/components/Option.vue b/src/components/Option.vue index d8688b35..19ec8c60 100755 --- a/src/components/Option.vue +++ b/src/components/Option.vue @@ -35,7 +35,7 @@ const handleMouseDownOnLabelContainer = (context) => onLeftClick(function handleMouseDownOnLabelContainer() { const { instance, node } = parseContext(context); - if (node.isBranch && instance.disableBranchNodes) { + if (node.isBranch && (instance.disableBranchNodes || !node.isCheckable)) { instance.toggleExpanded(node); } else { instance.select(node);