From 9c7e15f43f9fb6e8601dd72237e896f173c5450c Mon Sep 17 00:00:00 2001 From: Florian Schroedl Date: Thu, 28 Nov 2024 09:09:56 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20Disable=20group=20selection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/app/main/ui/workspace/tokens/sets.cljs | 15 ++++----------- .../src/app/main/ui/workspace/tokens/sets.scss | 8 ++++++++ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/tokens/sets.cljs b/frontend/src/app/main/ui/workspace/tokens/sets.cljs index bf7f42c8c..9e70302a1 100644 --- a/frontend/src/app/main/ui/workspace/tokens/sets.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/sets.cljs @@ -60,16 +60,8 @@ :default-value default-value}])) (mf/defc sets-tree-set-group - [{:keys [label tree-depth tree-path selected? collapsed? on-select editing? on-edit on-edit-reset on-edit-submit]}] + [{:keys [label tree-depth tree-path selected? collapsed? editing? on-edit on-edit-reset on-edit-submit]}] (let [editing?' (editing? tree-path) - on-click - (mf/use-fn - (mf/deps editing? tree-path) - (fn [event] - (dom/stop-propagation event) - (when-not (editing? tree-path) - (on-select tree-path)))) - on-context-menu (mf/use-fn (mf/deps editing? tree-path) @@ -86,12 +78,13 @@ :data-testid "tokens-set-group-item" :style {"--tree-depth" tree-depth} :class (stl/css-case :set-item-container true + :set-item-group true :selected-set selected?) - :on-click on-click :on-context-menu on-context-menu :on-double-click #(on-edit tree-path)} [:> icon-button* - {:on-click (fn [event] + {:class (stl/css :set-item-group-collapse-button) + :on-click (fn [event] (.stopPropagation event) (swap! collapsed? not)) :aria-label (tr "labels.collapse") diff --git a/frontend/src/app/main/ui/workspace/tokens/sets.scss b/frontend/src/app/main/ui/workspace/tokens/sets.scss index 10c7c83f0..a0a84192f 100644 --- a/frontend/src/app/main/ui/workspace/tokens/sets.scss +++ b/frontend/src/app/main/ui/workspace/tokens/sets.scss @@ -34,6 +34,14 @@ } } +.set-item-group { + cursor: unset; +} + +.set-item-group-collapse-button { + cursor: pointer; +} + .set-name { @include textEllipsis; flex-grow: 1;