Skip to content

Commit

Permalink
Remove reset! of external-model in input-text-base event handlers
Browse files Browse the repository at this point in the history
Fixes #219
  • Loading branch information
superstructor committed Dec 21, 2020
1 parent 00de609 commit 27fd1b3
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/re_com/misc.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -128,21 +128,18 @@
(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
(reset! external-model @internal-model)
(on-change @internal-model))
27 (reset! internal-model @external-model)
true)))}
Expand Down

0 comments on commit 27fd1b3

Please sign in to comment.