From 147de5e3059bca62c3a8bd42c6b1c9bf3dfc032c Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Tue, 21 Mar 2023 14:08:50 +0800 Subject: [PATCH] fix: select only the current block when open its context-menu --- src/main/frontend/components/content.cljs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/frontend/components/content.cljs b/src/main/frontend/components/content.cljs index 0685e0123..8771e8b55 100644 --- a/src/main/frontend/components/content.cljs +++ b/src/main/frontend/components/content.cljs @@ -18,6 +18,7 @@ [frontend.state :as state] [frontend.ui :as ui] [frontend.util :as util] + [frontend.modules.shortcut.core :as shortcut] [logseq.graph-parser.util :as gp-util] [logseq.graph-parser.util.block-ref :as block-ref] [frontend.util.url :as url-util] @@ -83,6 +84,7 @@ #(swap! *template-including-parent? not))]) (rum/defcs block-template < rum/reactive + (shortcut/disable-all-shortcuts) (rum/local false ::edit?) (rum/local "" ::input) {:will-unmount (fn [state] @@ -389,7 +391,8 @@ (and block-id (parse-uuid block-id)) (let [block (.closest target ".ls-block")] (when block - (util/select-highlight! [block])) + (state/clear-selection!) + (state/conj-selection-block! block :down)) (common-handler/show-custom-context-menu! e (block-context-menu-content target (uuid block-id))))