mirror of
https://github.com/penpot/penpot.git
synced 2026-05-29 19:58:09 +00:00
🐛 Fix broken import file type drodown options
This commit is contained in:
parent
41994703a9
commit
be43365909
@ -36,7 +36,7 @@
|
|||||||
[:on-click fn?]
|
[:on-click fn?]
|
||||||
[:options [:vector schema:option]]
|
[:options [:vector schema:option]]
|
||||||
[:selected :any]
|
[:selected :any]
|
||||||
[:focused :any]
|
[:focused {:optional true} :any]
|
||||||
[:empty-to-end {:optional true} :boolean]])
|
[:empty-to-end {:optional true} :boolean]])
|
||||||
|
|
||||||
(def ^:private
|
(def ^:private
|
||||||
|
|||||||
@ -52,14 +52,14 @@
|
|||||||
selected-option @selected-option*
|
selected-option @selected-option*
|
||||||
show-dropdown? (mf/use-state false)
|
show-dropdown? (mf/use-state false)
|
||||||
|
|
||||||
js-options (mf/use-memo
|
file-type-options (mf/use-memo
|
||||||
(mf/deps options)
|
(mf/deps options)
|
||||||
#(clj->js
|
#(mapv (fn [option]
|
||||||
(mapv (fn [option]
|
{:id (str (:value option))
|
||||||
{:id (str (:value option))
|
:label (:label option)
|
||||||
:label (:label option)
|
:aria-label (:label option)})
|
||||||
:aria-label (:label option)})
|
options))
|
||||||
options)))
|
|
||||||
button-text (if text-render
|
button-text (if text-render
|
||||||
(text-render selected-option)
|
(text-render selected-option)
|
||||||
(:label selected-option))
|
(:label selected-option))
|
||||||
@ -108,7 +108,7 @@
|
|||||||
:aria-label "Show options"}]
|
:aria-label "Show options"}]
|
||||||
|
|
||||||
[:& dropdown {:show @show-dropdown? :on-close close-dropdown}
|
[:& dropdown {:show @show-dropdown? :on-close close-dropdown}
|
||||||
[:> options-dropdown* {:options js-options
|
[:> options-dropdown* {:options file-type-options
|
||||||
:selected (str (:value selected-option))
|
:selected (str (:value selected-option))
|
||||||
:on-click handle-option-click
|
:on-click handle-option-click
|
||||||
:set-ref (fn [_] nil)}]]]))
|
:set-ref (fn [_] nil)}]]]))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user