0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 23:49:45 -05:00

🐛 Remove a decimal sets value to 0 (refactor)

This commit is contained in:
Pablo Alba 2022-03-22 10:07:32 +01:00
parent aa386e12bc
commit f0a9889f33

View file

@ -76,11 +76,8 @@
(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)
(str/strip-suffix ".")
(sm/expr-eval value))]
(cond
(d/num? new-value)