mirror of https://github.com/logseq/logseq
fix: select only the current block when open its context-menu
parent
de9ab536fe
commit
147de5e305
|
@ -18,6 +18,7 @@
|
||||||
[frontend.state :as state]
|
[frontend.state :as state]
|
||||||
[frontend.ui :as ui]
|
[frontend.ui :as ui]
|
||||||
[frontend.util :as util]
|
[frontend.util :as util]
|
||||||
|
[frontend.modules.shortcut.core :as shortcut]
|
||||||
[logseq.graph-parser.util :as gp-util]
|
[logseq.graph-parser.util :as gp-util]
|
||||||
[logseq.graph-parser.util.block-ref :as block-ref]
|
[logseq.graph-parser.util.block-ref :as block-ref]
|
||||||
[frontend.util.url :as url-util]
|
[frontend.util.url :as url-util]
|
||||||
|
@ -83,6 +84,7 @@
|
||||||
#(swap! *template-including-parent? not))])
|
#(swap! *template-including-parent? not))])
|
||||||
|
|
||||||
(rum/defcs block-template < rum/reactive
|
(rum/defcs block-template < rum/reactive
|
||||||
|
(shortcut/disable-all-shortcuts)
|
||||||
(rum/local false ::edit?)
|
(rum/local false ::edit?)
|
||||||
(rum/local "" ::input)
|
(rum/local "" ::input)
|
||||||
{:will-unmount (fn [state]
|
{:will-unmount (fn [state]
|
||||||
|
@ -389,7 +391,8 @@
|
||||||
(and block-id (parse-uuid block-id))
|
(and block-id (parse-uuid block-id))
|
||||||
(let [block (.closest target ".ls-block")]
|
(let [block (.closest target ".ls-block")]
|
||||||
(when block
|
(when block
|
||||||
(util/select-highlight! [block]))
|
(state/clear-selection!)
|
||||||
|
(state/conj-selection-block! block :down))
|
||||||
(common-handler/show-custom-context-menu!
|
(common-handler/show-custom-context-menu!
|
||||||
e
|
e
|
||||||
(block-context-menu-content target (uuid block-id))))
|
(block-context-menu-content target (uuid block-id))))
|
||||||
|
|
Loading…
Reference in New Issue