From 5ccb0cc11ec5922efc427b76419aca05aa9087d6 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Wed, 19 Jun 2024 17:36:28 +0800 Subject: [PATCH] fix: press Enter when creating a property will insert a block --- src/main/frontend/components/property.cljs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/frontend/components/property.cljs b/src/main/frontend/components/property.cljs index 6b6a263a0..0ef917ab2 100644 --- a/src/main/frontend/components/property.cljs +++ b/src/main/frontend/components/property.cljs @@ -451,7 +451,10 @@ (rum/local false ::show-new-property-config?) (rum/local false ::show-class-select?) (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) *property-key (second args) {:keys [original-block edit-original-block]} (last args) @@ -460,6 +463,7 @@ (when *property-key (reset! *property-key nil)) (when (and original-block edit-original-block) (edit-original-block {:editing-default-property? editing-default-property?}))) + (state/set-editor-action! nil) state)} [state block *property-key {:keys [class-schema? page? page-configure?] :as opts}]