mirror of
https://github.com/penpot/penpot.git
synced 2025-02-03 21:09:00 -05:00
🐛 Remove a decimal sets value to 0 (refactor)
This commit is contained in:
parent
aa386e12bc
commit
f0a9889f33
1 changed files with 1 additions and 4 deletions
|
@ -76,11 +76,8 @@
|
||||||
(mf/deps ref min-val max-val value nillable default-val)
|
(mf/deps ref min-val max-val value nillable default-val)
|
||||||
(fn []
|
(fn []
|
||||||
(let [input-node (mf/ref-val ref)
|
(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)
|
new-value (-> (dom/get-value input-node)
|
||||||
(drop-ending-point)
|
(str/strip-suffix ".")
|
||||||
(sm/expr-eval value))]
|
(sm/expr-eval value))]
|
||||||
(cond
|
(cond
|
||||||
(d/num? new-value)
|
(d/num? new-value)
|
||||||
|
|
Loading…
Add table
Reference in a new issue