fix: remove setTimeout for setting editor args temporally

This commit is contained in:
Tienson Qin
2021-05-21 12:11:59 +08:00
parent 6d0cb2383b
commit a494d25e54
2 changed files with 3 additions and 2 deletions

View File

@@ -382,7 +382,8 @@
;; if we quickly click into a block when editing another block,
;; this will happen before the `will-unmount` event, which will
;; lost the content in the editing block.
(js/setTimeout #(state/set-editor-args! (:rum/args state)) 20)
(state/set-editor-args! (:rum/args state))
;; (js/setTimeout #(state/set-editor-args! (:rum/args state)) 20)
state)}
(mixins/event-mixin setup-key-listener!)
(shortcut/mixin :shortcut.handler/block-editing-only)

View File

@@ -1570,7 +1570,7 @@
(defn get-matched-commands
[input]
(try
(let [edit-content (gobj/get input "value")
(let [edit-content (or (gobj/get input "value") "")
pos (util/get-input-pos input)
last-slash-caret-pos (:pos @*slash-caret-pos)
last-command (and last-slash-caret-pos (subs edit-content last-slash-caret-pos pos))]