mirror of
https://github.com/penpot/penpot.git
synced 2025-01-09 00:10:11 -05:00
🐛 Fix problem with input fast change
This commit is contained in:
parent
bed13c24df
commit
de1dae7f93
1 changed files with 2 additions and 9 deletions
|
@ -152,7 +152,7 @@
|
|||
|
||||
handle-key-down
|
||||
(mf/use-fn
|
||||
(mf/deps set-delta apply-value update-input)
|
||||
(mf/deps set-delta apply-value update-input parse-value)
|
||||
(fn [event]
|
||||
(mf/set-ref-val! dirty-ref true)
|
||||
(let [up? (kbd/up-arrow? event)
|
||||
|
@ -162,19 +162,13 @@
|
|||
node (mf/ref-val ref)]
|
||||
(when (or up? down?)
|
||||
(set-delta event up? down?))
|
||||
(reset! last-value* (parse-value))
|
||||
(when enter?
|
||||
(dom/blur! node))
|
||||
(when esc?
|
||||
(update-input value-str)
|
||||
(dom/blur! node)))))
|
||||
|
||||
handle-key-up
|
||||
(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)
|
||||
|
@ -231,7 +225,6 @@
|
|||
(obj/set! "defaultValue" (fmt/format-number value))
|
||||
(obj/set! "title" title)
|
||||
(obj/set! "onKeyDown" handle-key-down)
|
||||
(obj/set! "onKeyUp" handle-key-up)
|
||||
(obj/set! "onBlur" handle-blur)
|
||||
(obj/set! "onFocus" handle-focus))]
|
||||
|
||||
|
|
Loading…
Reference in a new issue