Browse Source

fix: property area blink when adding a new text property

Tienson Qin 1 year ago
parent
commit
bcd0217d53
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/main/frontend/components/property/value.cljs

+ 3 - 2
src/main/frontend/components/property/value.cljs

@@ -35,6 +35,7 @@
 
 (defn exit-edit-property
   []
+  (state/set-state! :editor/new-property-key nil)
   (state/set-state! :editor/new-property-input-id nil)
   (state/set-state! :editor/properties nil)
   (state/clear-edit!))
@@ -311,11 +312,11 @@
     (when (not (state/get-editor-action))
       (util/stop e)
       (p/do!
-       (exit-edit-property)
        (when (not= new-value value)
          (property-handler/set-block-property! repo (:block/uuid block)
                                                (:block/original-name property)
-                                               (string/trim new-value)))))))
+                                               (string/trim new-value)))
+       (exit-edit-property)))))
 
 (defn <create-new-block!
   [block property value]