mirror of https://github.com/status-im/reagent.git
Fix indentation and style
This commit is contained in:
parent
63515236cb
commit
2f6f2a4491
|
@ -107,7 +107,8 @@
|
|||
;; <input type="??" >
|
||||
;; The properites 'selectionStart' and 'selectionEnd' only exist on some inputs
|
||||
;; See: https://html.spec.whatwg.org/multipage/forms.html#do-not-apply
|
||||
(def these-inputs-have-selection-api #{"text" "textarea" "password" "search" "tel" "url"})
|
||||
(def these-inputs-have-selection-api #{"text" "textarea" "password" "search"
|
||||
"tel" "url"})
|
||||
|
||||
(defn ^boolean has-selection-api?
|
||||
[input-type]
|
||||
|
@ -119,11 +120,11 @@
|
|||
(let [node (find-dom-node this)
|
||||
node-value ($ node :value)]
|
||||
(when (not= value node-value)
|
||||
(if-not (and (identical? node (.-activeElement js/document))
|
||||
(if-not (and (identical? node ($ js/document :activeElement))
|
||||
(has-selection-api? ($ node :type))
|
||||
(string? value)
|
||||
(string? node-value))
|
||||
; just set the value, no need to worry about a cursor
|
||||
;; just set the value, no need to worry about a cursor
|
||||
($! node :value value)
|
||||
|
||||
;; Setting "value" (below) moves the cursor position to the
|
||||
|
|
Loading…
Reference in New Issue