From d5b2a91bce1ac905b7cbb50ab3b3b2c41df4af3f Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 14 Mar 2024 12:42:07 +0100 Subject: [PATCH] :bug: Fix problem with fast change between numeric inputs --- frontend/src/app/main/ui/components/numeric_input.cljs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/main/ui/components/numeric_input.cljs b/frontend/src/app/main/ui/components/numeric_input.cljs index 54965605e..134a01440 100644 --- a/frontend/src/app/main/ui/components/numeric_input.cljs +++ b/frontend/src/app/main/ui/components/numeric_input.cljs @@ -169,6 +169,13 @@ (update-input value-str) (dom/blur! node))))) + handle-change + (mf/use-fn + (mf/deps parse-value) + (fn [] + ;; Store the last value inputed + (reset! last-value* (parse-value)))) + handle-mouse-wheel (mf/use-fn (mf/deps set-delta) @@ -218,7 +225,7 @@ (obj/unset! "selectOnFocus") (obj/unset! "nillable") (obj/set! "value" mf/undefined) - (obj/set! "onChange" mf/undefined) + (obj/set! "onChange" handle-change) (obj/set! "className" class) (obj/set! "type" "text") (obj/set! "ref" ref)