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

🐛 Fix can't collapse colors and typograhies groups when searching assets

This commit is contained in:
Pablo Alba 2024-07-11 11:51:40 +02:00
parent a457f8baf5
commit 166b8c806c
2 changed files with 7 additions and 3 deletions

View file

@ -264,8 +264,10 @@
multi-colors? multi-assets? on-asset-click on-assets-delete
on-clear-selection on-group on-rename-group on-ungroup colors
selected-full]}]
(let [group-open? (or ^boolean force-open?
^boolean (get open-groups prefix (if (= prefix "") true false)))
(let [group-open? (if (false? (get open-groups prefix)) ;; if the user has closed it specifically, respect that
false
(or ^boolean force-open?
^boolean (get open-groups prefix (if (= prefix "") true false))))
dragging* (mf/use-state false)
dragging? (deref dragging*)

View file

@ -128,7 +128,9 @@
[{:keys [file-id prefix groups open-groups force-open? file local? selected local-data
editing-id renaming-id on-asset-click handle-change apply-typography on-rename-group
on-ungroup on-context-menu selected-full]}]
(let [group-open? (get open-groups prefix true)
(let [group-open? (if (false? (get open-groups prefix)) ;; if the user has closed it specifically, respect that
false
(get open-groups prefix true))
dragging* (mf/use-state false)
dragging? (deref dragging*)
selected-paths (mf/with-memo [selected-full]