mirror of https://github.com/status-im/reagent.git
Don't try to reposition cursor when input value isn't a string
Fixes #183
This commit is contained in:
parent
db54d327e9
commit
8766d722b8
|
@ -1,4 +1,4 @@
|
||||||
(defproject reagent "0.5.1-rc2"
|
(defproject reagent "0.5.1-SNAPSHOT"
|
||||||
:url "http://github.com/reagent-project/reagent"
|
:url "http://github.com/reagent-project/reagent"
|
||||||
:license {:name "MIT"}
|
:license {:name "MIT"}
|
||||||
:description "A simple ClojureScript interface to React"
|
:description "A simple ClojureScript interface to React"
|
||||||
|
|
|
@ -106,7 +106,9 @@
|
||||||
node-value (.' node :value)]
|
node-value (.' node :value)]
|
||||||
(when (not= value node-value)
|
(when (not= value node-value)
|
||||||
(if-not (and (identical? node (.-activeElement js/document))
|
(if-not (and (identical? node (.-activeElement js/document))
|
||||||
(has-selection-api? (.' node :type)))
|
(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)
|
(.! node :value value)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue