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

Merge pull request #4993 from penpot/eva-fix-fill-menu

🐛 Fix collapsing fill menu
This commit is contained in:
Andrey Antukh 2024-08-14 13:09:03 +02:00 committed by GitHub
commit fc14871d01
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 6 deletions

View file

@ -54,7 +54,7 @@
has-fills? (or (= :multiple fills) (some? (seq fills)))
state* (mf/use-state true)
state* (mf/use-state has-fills?)
open? (deref state*)
toggle-content (mf/use-fn #(swap! state* not))
@ -94,7 +94,7 @@
(st/emit! (dc/remove-fill ids {:color default-color
:opacity 1} index))
(when (or (= :multiple fills)
(= 1 (count (seq fills))))
(= 0 (count (seq fills))))
(close-content))))
on-remove-all
@ -149,7 +149,7 @@
:data-testid "add-fill"
:on-click on-add} i/add])]]
(when (and open? has-fills?)
(when open?
[:div {:class (stl/css :element-content)}
(cond
(= :multiple fills)

View file

@ -97,14 +97,11 @@
(when-not (str/empty? value)
(st/emit! (dc/change-stroke ids {:stroke-alignment value} index))))
on-stroke-width-change
(fn [index value]
(when-not (str/empty? value)
(st/emit! (dc/change-stroke ids {:stroke-width value} index))))
open-caps-select
(fn [caps-state]
(fn [event]