From 6689d886d7571dea820b7345e425812a9dc08e27 Mon Sep 17 00:00:00 2001 From: charlie Date: Fri, 12 May 2023 11:27:23 +0800 Subject: [PATCH] fix(ux): automatic block number list for semantic input --- src/main/frontend/handler/editor.cljs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/frontend/handler/editor.cljs b/src/main/frontend/handler/editor.cljs index cab9e2f908..6cffe63c7b 100644 --- a/src/main/frontend/handler/editor.cljs +++ b/src/main/frontend/handler/editor.cljs @@ -1832,8 +1832,9 @@ (and (= content "1. ") (= last-input-char " ") input-id edit-block (not (own-order-number-list? edit-block))) (do - (state/pub-event! [:editor/toggle-own-number-list edit-block]) - (state/set-edit-content! input-id "")) + (state/set-edit-content! input-id "") + (-> (p/delay 10) + (p/then #(state/pub-event! [:editor/toggle-own-number-list edit-block])))) (and (= last-input-char (state/get-editor-command-trigger)) (or (re-find #"(?m)^/" (str (.-value input))) (start-of-new-word? input pos)))