mirror of
https://github.com/penpot/penpot.git
synced 2026-05-15 21:13:58 +00:00
🐛 Save numeric input value on unmount (#9548)
This commit is contained in:
parent
9021544c05
commit
fb2734cd02
@ -19,6 +19,7 @@
|
||||
[app.main.ui.ds.controls.utilities.token-field :refer [token-field*]]
|
||||
[app.main.ui.ds.foundations.assets.icon :refer [icon* icon-list] :as i]
|
||||
[app.main.ui.formats :as fmt]
|
||||
[app.main.ui.hooks :as h]
|
||||
[app.main.ui.workspace.tokens.management.forms.controls.utils :as csu]
|
||||
[app.util.dom :as dom]
|
||||
[app.util.i18n :refer [tr]]
|
||||
@ -393,6 +394,8 @@
|
||||
(on-blur event))
|
||||
(dom/blur! (mf/ref-val ref))))
|
||||
|
||||
handle-unmount (h/use-ref-callback handle-blur)
|
||||
|
||||
on-key-down
|
||||
(mf/use-fn
|
||||
(mf/deps is-open apply-value update-input is-open focused-id handle-focus-change)
|
||||
@ -768,6 +771,8 @@
|
||||
(mf/with-effect [dropdown-options]
|
||||
(mf/set-ref-val! options-ref dropdown-options))
|
||||
|
||||
(mf/with-effect [handle-unmount] handle-unmount)
|
||||
|
||||
[:div {:class [class (stl/css-case :input-wrapper true
|
||||
:resizable (not is-token-applied?))]
|
||||
:ref wrapper-ref
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user