mirror of https://github.com/status-im/reagent.git
Make sure inputs don't lose focus
selectionStart/End should not be set on inputs that don't have focus currently.
This commit is contained in:
parent
6548e7ef76
commit
5bbba3e30a
|
@ -105,7 +105,8 @@
|
|||
(let [node (.' this getDOMNode)
|
||||
node-value (.' node :value)]
|
||||
(when (not= value node-value)
|
||||
(if-not (has-selection-api? (.' node :type))
|
||||
(if-not (and (identical? node (.-activeElement js/document))
|
||||
(has-selection-api? (.' node :type)))
|
||||
; just set the value, no need to worry about a cursor
|
||||
(.! node :value value)
|
||||
|
||||
|
|
Loading…
Reference in New Issue