Skip to content

Commit

Permalink
Fixed #187 - an input-text bug where what's displayed in the componen…
Browse files Browse the repository at this point in the history
…t can get out of sync with what the caller sends to it
  • Loading branch information
Gregg8 committed Nov 2, 2018
1 parent c76b5e5 commit ebad92b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/re_com/misc.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,22 @@
(if validation-regex (re-find validation-regex new-val) true))
(reset! internal-model new-val)
(when-not change-on-blur?
(reset! external-model @internal-model)
(on-change @internal-model)))))
:on-blur (handler-fn
(when (and
on-change
change-on-blur?
(not= @internal-model @external-model))
(reset! external-model @internal-model)
(on-change @internal-model)))
:on-key-up (handler-fn
(if disabled?
(.preventDefault event)
(case (.-which event)
13 (when on-change (on-change @internal-model))
13 (when on-change
(reset! external-model @internal-model)
(on-change @internal-model))
27 (reset! internal-model @external-model)
true)))}
attr)]]
Expand Down

0 comments on commit ebad92b

Please sign in to comment.