Browse Source

fix: link disappears when clicking outside the editor

Tienson Qin 4 years ago
parent
commit
9eb17afc6a
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/main/frontend/components/block.cljs

+ 5 - 1
src/main/frontend/components/block.cljs

@@ -1443,7 +1443,11 @@
         (let [block (or (db/pull [:block/uuid (:block/uuid block)]) block)
               f #(let [cursor-range (util/caret-range (gdom/getElement block-id))
                        content (property/remove-built-in-properties (:block/format block)
-                                                                 content)]
+                                                                    content)]
+                   ;; save current editing block
+                   (let [{:keys [value] :as state} (editor-handler/get-state)]
+                     (editor-handler/save-block! state value))
+
                    (state/set-editing!
                     edit-input-id
                     content