mirror of
https://github.com/penpot/penpot.git
synced 2025-02-18 21:06:11 -05:00
🐛 Fix numeric-input component.
This commit is contained in:
parent
c2f604cd01
commit
53e6d7ef2a
2 changed files with 7 additions and 2 deletions
|
@ -162,5 +162,12 @@
|
||||||
(obj/set! "onKeyDown" handle-key-down)
|
(obj/set! "onKeyDown" handle-key-down)
|
||||||
(obj/set! "onBlur" handle-blur))]
|
(obj/set! "onBlur" handle-blur))]
|
||||||
|
|
||||||
|
(mf/use-effect
|
||||||
|
(mf/deps value-str)
|
||||||
|
(fn []
|
||||||
|
(when-let [input-node (mf/ref-val ref)]
|
||||||
|
(when-not (dom/active? input-node)
|
||||||
|
(dom/set-value! input-node value-str)))))
|
||||||
|
|
||||||
[:> :input props]))
|
[:> :input props]))
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,6 @@
|
||||||
(fn [value]
|
(fn [value]
|
||||||
(on-change (assoc-in grid keys-path value))))
|
(on-change (assoc-in grid keys-path value))))
|
||||||
|
|
||||||
;; TODO: remove references to :auto
|
|
||||||
handle-change-size
|
handle-change-size
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps grid)
|
(mf/deps grid)
|
||||||
|
@ -75,7 +74,6 @@
|
||||||
(-> (gg/calculate-default-item-length frame-length margin gutter)
|
(-> (gg/calculate-default-item-length frame-length margin gutter)
|
||||||
(mth/precision 2))
|
(mth/precision 2))
|
||||||
item-length)]
|
item-length)]
|
||||||
|
|
||||||
(-> grid
|
(-> grid
|
||||||
(update :params assoc :size size :item-length item-length)
|
(update :params assoc :size size :item-length item-length)
|
||||||
(on-change)))))
|
(on-change)))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue