mirror of
https://github.com/penpot/penpot.git
synced 2025-05-04 22:15:58 +02:00
🐛 Fix incorrect internal form initialization
This commit is contained in:
parent
9b71e04e1c
commit
3ddd45e99b
2 changed files with 4 additions and 4 deletions
|
@ -73,7 +73,9 @@
|
||||||
{::mf/register modal/components
|
{::mf/register modal/components
|
||||||
::mf/register-as :team-form}
|
::mf/register-as :team-form}
|
||||||
[{:keys [team] :as props}]
|
[{:keys [team] :as props}]
|
||||||
(let [initial (mf/use-memo (fn [] (or team {})))
|
(let [initial (mf/use-memo (fn []
|
||||||
|
(or (some-> team (select-keys [:name :id]))
|
||||||
|
{})))
|
||||||
form (fm/use-form :schema schema:team-form
|
form (fm/use-form :schema schema:team-form
|
||||||
:initial initial)
|
:initial initial)
|
||||||
handle-keydown
|
handle-keydown
|
||||||
|
|
|
@ -148,9 +148,7 @@
|
||||||
(mf/set-ref-val! internal-state initial))
|
(mf/set-ref-val! internal-state initial))
|
||||||
|
|
||||||
(mf/with-effect [initial]
|
(mf/with-effect [initial]
|
||||||
(if (fn? initial)
|
(swap! form-mutator d/deep-merge initial))
|
||||||
(swap! form-mutator update :data merge (initial))
|
|
||||||
(swap! form-mutator update :data merge initial)))
|
|
||||||
|
|
||||||
form-mutator))
|
form-mutator))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue