mirror of
https://github.com/penpot/penpot.git
synced 2025-07-24 06:17:11 +02:00
✨ Make the multi-input more generic
This commit is contained in:
parent
a1c3789ec2
commit
cfe657d853
6 changed files with 173 additions and 148 deletions
|
@ -121,6 +121,13 @@
|
|||
(assoc-in [:data field] (if trim? (str/trim value) value))
|
||||
(update :errors dissoc field))))))
|
||||
|
||||
(defn update-input-value!
|
||||
[form field value]
|
||||
(swap! form (fn [state]
|
||||
(-> state
|
||||
(assoc-in [:data field] value)
|
||||
(update :errors dissoc field)))))
|
||||
|
||||
(defn on-input-blur
|
||||
[form field]
|
||||
(fn [_]
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
(def ctrlKey? (or (is-key? "Control")
|
||||
(is-key? "Meta")))
|
||||
(def comma? (is-key? ","))
|
||||
(def backspace? (is-key? "Backspace"))
|
||||
|
||||
(defn editing? [e]
|
||||
(.-editing ^js e))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue