From 9183d6640202e70394367c6d9255b7ccb49db6b7 Mon Sep 17 00:00:00 2001 From: Erik Verheul Date: Fri, 2 Feb 2024 20:58:52 +0100 Subject: [PATCH] Disallow selection of the root node --- src/components/views/sl-vue-tree/sl-vue-tree.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/views/sl-vue-tree/sl-vue-tree.js b/src/components/views/sl-vue-tree/sl-vue-tree.js index 4380a2a1..8e9ad980 100644 --- a/src/components/views/sl-vue-tree/sl-vue-tree.js +++ b/src/components/views/sl-vue-tree/sl-vue-tree.js @@ -189,6 +189,9 @@ const methods = { }, onNodeMousedownHandler(event, node) { + // disallow selection of the root node + if (node.level === 1) return + if (!this.isRoot) { this.getRootComponent().onNodeMousedownHandler(event, node) return