diff --git a/CHANGES.md b/CHANGES.md index d3f40638d..0af3688dc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -25,6 +25,7 @@ - Add the ability to disable standard, password login [Taiga #2999](https://tree.taiga.io/project/penpot/us/2999) ### :bug: Bugs fixed +- Remove a decimal sets value to 0 [Taiga #3059](https://tree.taiga.io/project/penpot/issue/3054) - Go to style library file to edit in a new tab [Taiga #2639](https://tree.taiga.io/project/penpot/issue/2639) - Inner shadow with border not working properly [Taiga #2883](https://tree.taiga.io/project/penpot/issue/2883) - Fix ellipsis in long page names [Taiga #2962](https://tree.taiga.io/project/penpot/issue/2962) diff --git a/frontend/src/app/main/ui/components/numeric_input.cljs b/frontend/src/app/main/ui/components/numeric_input.cljs index fc8cabb21..a6c291ce8 100644 --- a/frontend/src/app/main/ui/components/numeric_input.cljs +++ b/frontend/src/app/main/ui/components/numeric_input.cljs @@ -14,6 +14,7 @@ [app.util.keyboard :as kbd] [app.util.object :as obj] [app.util.simple-math :as sm] + [cuerdas.core :as str] [goog.events :as events] [rumext.alpha :as mf]) (:import goog.events.EventType)) @@ -75,7 +76,11 @@ (mf/deps ref min-val max-val value nillable default-val) (fn [] (let [input-node (mf/ref-val ref) + drop-ending-point #(if (str/ends-with? % ".") + (str/join "" (drop-last %)) + %) new-value (-> (dom/get-value input-node) + (drop-ending-point) (sm/expr-eval value))] (cond (d/num? new-value)