Undoes old way of doing forms in favor of context version. Much easier

This commit is contained in:
2022-07-17 17:32:47 -07:00
parent a17f587ff3
commit b6962c5bfa
17 changed files with 782 additions and 1393 deletions

View File

@@ -5,7 +5,7 @@
[react :as react]))
(def good-$ #"^\-?[0-9]+(\.[0-9][0-9])?$")
(defn -money-field [{:keys [min max disabled on-change value class style]}]
(defn -money-field [{:keys [min max disabled on-change value class style placeholder]}]
(let [[ parsed-amount set-parsed-amount] (react/useState {:parsed value
:raw (cond
(str/blank? value)
@@ -40,6 +40,7 @@
[:div.control.has-icons-left
[:input.input {:type "text"
:disabled disabled
:placeholder placeholder
:class class
:on-change (fn [e]
(let [raw (.. e -target -value)