mirror of
https://github.com/penpot/penpot.git
synced 2025-05-19 09:06:12 +02:00
🐛 Fix survey select 'other' options
This commit is contained in:
parent
ae4fe73ac9
commit
0d7cac28c4
2 changed files with 31 additions and 10 deletions
|
@ -234,13 +234,15 @@
|
|||
i/arrow-slide]]]))
|
||||
|
||||
(mf/defc radio-buttons
|
||||
[{:keys [name options form trim] :as props}]
|
||||
(let [form (or form (mf/use-ctx form-ctx))
|
||||
value (get-in @form [:data name] "")
|
||||
[{:keys [name options form trim on-change-value] :as props}]
|
||||
(let [form (or form (mf/use-ctx form-ctx))
|
||||
value (get-in @form [:data name] "")
|
||||
on-change-value (or on-change-value (constantly nil))
|
||||
on-change (fn [event]
|
||||
(let [value (-> event dom/get-target dom/get-value)]
|
||||
(swap! form assoc-in [:touched name] true)
|
||||
(fm/on-input-change form name value trim)))]
|
||||
(fm/on-input-change form name value trim)
|
||||
(on-change-value name value)))]
|
||||
[:div.custom-radio
|
||||
(for [item options]
|
||||
(let [id (str/ffmt "%-%" name (:value item))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue