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:
commit
fc14871d01
2 changed files with 3 additions and 6 deletions
|
@ -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)
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Add table
Reference in a new issue