diff --git a/src/components/sidebar/tabs/NodeLibrarySidebarTab.vue b/src/components/sidebar/tabs/NodeLibrarySidebarTab.vue index edc48982b..009564f05 100644 --- a/src/components/sidebar/tabs/NodeLibrarySidebarTab.vue +++ b/src/components/sidebar/tabs/NodeLibrarySidebarTab.vue @@ -95,7 +95,7 @@ import _ from 'lodash' import { useTreeExpansion } from '@/hooks/treeHooks' const nodeDefStore = useNodeDefStore() -const { expandedKeys, expandNode, onNonLeafClick } = useTreeExpansion() +const { expandedKeys, expandNode, toggleNodeOnEvent } = useTreeExpansion() const alphabeticalSort = ref(false) const hoveredComfyNodeName = ref(null) @@ -252,7 +252,7 @@ const handleSearch = (query: string) => { const onNodeContentClick = (e: MouseEvent, node: TreeNode) => { if (!node.key) return if (node.type === 'folder') { - onNonLeafClick(e, node) + toggleNodeOnEvent(e, node) } else { insertNode(node.data) } diff --git a/src/hooks/treeHooks.ts b/src/hooks/treeHooks.ts index a345298bc..421e626e6 100644 --- a/src/hooks/treeHooks.ts +++ b/src/hooks/treeHooks.ts @@ -54,7 +54,7 @@ export function useTreeExpansion() { } } - const onNonLeafClick = (e: MouseEvent, node: TreeNode) => { + const toggleNodeOnEvent = (e: MouseEvent | KeyboardEvent, node: TreeNode) => { if (e.ctrlKey) { toggleNodeRecursive(node) } else { @@ -68,6 +68,6 @@ export function useTreeExpansion() { toggleNodeRecursive, expandNode, collapseNode, - onNonLeafClick + toggleNodeOnEvent } }