mirror of
https://github.com/penpot/penpot.git
synced 2025-02-03 04:49:03 -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)))
|
has-fills? (or (= :multiple fills) (some? (seq fills)))
|
||||||
|
|
||||||
|
|
||||||
state* (mf/use-state true)
|
state* (mf/use-state has-fills?)
|
||||||
open? (deref state*)
|
open? (deref state*)
|
||||||
|
|
||||||
toggle-content (mf/use-fn #(swap! state* not))
|
toggle-content (mf/use-fn #(swap! state* not))
|
||||||
|
@ -94,7 +94,7 @@
|
||||||
(st/emit! (dc/remove-fill ids {:color default-color
|
(st/emit! (dc/remove-fill ids {:color default-color
|
||||||
:opacity 1} index))
|
:opacity 1} index))
|
||||||
(when (or (= :multiple fills)
|
(when (or (= :multiple fills)
|
||||||
(= 1 (count (seq fills))))
|
(= 0 (count (seq fills))))
|
||||||
(close-content))))
|
(close-content))))
|
||||||
|
|
||||||
on-remove-all
|
on-remove-all
|
||||||
|
@ -149,7 +149,7 @@
|
||||||
:data-testid "add-fill"
|
:data-testid "add-fill"
|
||||||
:on-click on-add} i/add])]]
|
:on-click on-add} i/add])]]
|
||||||
|
|
||||||
(when (and open? has-fills?)
|
(when open?
|
||||||
[:div {:class (stl/css :element-content)}
|
[:div {:class (stl/css :element-content)}
|
||||||
(cond
|
(cond
|
||||||
(= :multiple fills)
|
(= :multiple fills)
|
||||||
|
|
|
@ -97,14 +97,11 @@
|
||||||
(when-not (str/empty? value)
|
(when-not (str/empty? value)
|
||||||
(st/emit! (dc/change-stroke ids {:stroke-alignment value} index))))
|
(st/emit! (dc/change-stroke ids {:stroke-alignment value} index))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
on-stroke-width-change
|
on-stroke-width-change
|
||||||
(fn [index value]
|
(fn [index value]
|
||||||
(when-not (str/empty? value)
|
(when-not (str/empty? value)
|
||||||
(st/emit! (dc/change-stroke ids {:stroke-width value} index))))
|
(st/emit! (dc/change-stroke ids {:stroke-width value} index))))
|
||||||
|
|
||||||
|
|
||||||
open-caps-select
|
open-caps-select
|
||||||
(fn [caps-state]
|
(fn [caps-state]
|
||||||
(fn [event]
|
(fn [event]
|
||||||
|
|
Loading…
Add table
Reference in a new issue