0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-20 05:34:23 -05:00

💄 Disable group selection

This commit is contained in:
Florian Schroedl 2024-11-28 09:09:56 +01:00
parent f0735417f4
commit 9c7e15f43f
2 changed files with 12 additions and 11 deletions

View file

@ -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")

View file

@ -34,6 +34,14 @@
}
}
.set-item-group {
cursor: unset;
}
.set-item-group-collapse-button {
cursor: pointer;
}
.set-name {
@include textEllipsis;
flex-grow: 1;