fix: press Enter when creating a property will insert a block

experiment/tanstack-table
Tienson Qin 2024-06-19 17:36:28 +08:00
parent 8f530f2dde
commit 5ccb0cc11e
1 changed files with 5 additions and 1 deletions

View File

@ -451,7 +451,10 @@
(rum/local false ::show-new-property-config?) (rum/local false ::show-new-property-config?)
(rum/local false ::show-class-select?) (rum/local false ::show-class-select?)
(rum/local {} ::property-schema) (rum/local {} ::property-schema)
{:will-unmount (fn [state] {:init (fn [state]
(state/set-editor-action! :property-input)
state)
:will-unmount (fn [state]
(let [args (:rum/args state) (let [args (:rum/args state)
*property-key (second args) *property-key (second args)
{:keys [original-block edit-original-block]} (last args) {:keys [original-block edit-original-block]} (last args)
@ -460,6 +463,7 @@
(when *property-key (reset! *property-key nil)) (when *property-key (reset! *property-key nil))
(when (and original-block edit-original-block) (when (and original-block edit-original-block)
(edit-original-block {:editing-default-property? editing-default-property?}))) (edit-original-block {:editing-default-property? editing-default-property?})))
(state/set-editor-action! nil)
state)} state)}
[state block *property-key {:keys [class-schema? page? page-configure?] [state block *property-key {:keys [class-schema? page? page-configure?]
:as opts}] :as opts}]