Do not use :on-click on <option>

This does not work in Chrome.
parent 2e49a44a
Pipeline #31412895 passed with stages
in 1 minute and 48 seconds
......@@ -144,24 +144,24 @@
[:p
"Binary encoding: "
[:select
{:defaultValue @binary-encoding}
{:defaultValue @binary-encoding
:on-change #(reset! binary-encoding (-> % .-target .-value keyword))}
(for [{key :key name :name} binary/all-converters]
^{:key key}
[:option
{:on-click #(reset! binary-encoding key)
:value key}
{:value key}
name])]])
(defn unit-field []
[:p
"Unit: "
[:select
{:defaultValue @unit}
{:defaultValue @unit
:on-change #(reset! unit (-> % .-target .-value keyword))}
(for [{:keys [:name :key]} units/all]
^{:key key}
[:option
{:on-click #(reset! unit key)
:value key}
{:value key}
name])]])
(defn accounts-refresh-button []
......@@ -174,12 +174,14 @@
[:p
[:label label]
[:select
{:on-change #(reset! account-atom
(get @accounts (converter/decode binary/raw (-> % .-target .-value))))}
[:option "———"]
(for [account (vals @accounts)]
(let [address (::a/address account)]
^{:key address}
[:option
{:on-click #(reset! account-atom account)}
{:value address}
(::a/label account)]))]])
(defn amount-field
......@@ -368,10 +370,10 @@
(fn []
[:div
[:select
{:on-change #(reset! selected-type (-> % .-target .-value keyword))}
(for [[type _] types]
^{:key type}
[:option {:value type
:on-click #(reset! selected-type type)}
[:option {:value type}
type])]
[(get types @selected-type)]
])))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment