0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 07:29:08 -05:00

Merge pull request #4871 from penpot/palba-fix-collapse-groups

🐛 Fix can't collapse colors and typograhies groups when searching assets
This commit is contained in:
Alejandro 2024-07-24 10:20:42 +02:00 committed by GitHub
commit 51611fbc09
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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 multi-colors? multi-assets? on-asset-click on-assets-delete
on-clear-selection on-group on-rename-group on-ungroup colors on-clear-selection on-group on-rename-group on-ungroup colors
selected-full]}] selected-full]}]
(let [group-open? (or ^boolean force-open? (let [group-open? (if (false? (get open-groups prefix)) ;; if the user has closed it specifically, respect that
^boolean (get open-groups prefix (if (= prefix "") true false))) false
(or ^boolean force-open?
^boolean (get open-groups prefix (if (= prefix "") true false))))
dragging* (mf/use-state false) dragging* (mf/use-state false)
dragging? (deref dragging*) dragging? (deref dragging*)

View file

@ -128,7 +128,9 @@
[{:keys [file-id prefix groups open-groups force-open? file local? selected local-data [{: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 editing-id renaming-id on-asset-click handle-change apply-typography on-rename-group
on-ungroup on-context-menu selected-full]}] 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* (mf/use-state false)
dragging? (deref dragging*) dragging? (deref dragging*)
selected-paths (mf/with-memo [selected-full] selected-paths (mf/with-memo [selected-full]