mirror of
https://github.com/logseq/logseq.git
synced 2026-04-30 08:56:29 +00:00
fix: pointerdown shouldn't edit a block from codemirror
This commit is contained in:
@@ -474,19 +474,17 @@
|
||||
shifted?
|
||||
(case key-code
|
||||
"Enter"
|
||||
(when-let [blockid (some-> (.-target e) (.closest "[blockid]") (.getAttribute "blockid"))]
|
||||
(code-handler/save-code-editor!)
|
||||
(js/setTimeout
|
||||
(when-let [blockid (some-> (.-target e) (.closest "[blockid]") (.getAttribute "blockid"))]
|
||||
(code-handler/save-code-editor!)
|
||||
(js/setTimeout
|
||||
#(editor-handler/api-insert-new-block! ""
|
||||
{:block-uuid (uuid blockid)
|
||||
:sibling? true}) 32))
|
||||
{:block-uuid (uuid blockid)
|
||||
:sibling? true}) 32))
|
||||
nil)))))
|
||||
(.addEventListener element "pointerdown"
|
||||
(fn [e]
|
||||
(.stopPropagation e)
|
||||
(state/clear-selection!)
|
||||
(when-let [block (and (:block/uuid config) (into {} (db/get-block-by-uuid (:block/uuid config))))]
|
||||
(state/set-editing! id (.getValue editor) block nil {:move-cursor? false}))))
|
||||
(state/clear-selection!)))
|
||||
(.addEventListener element "touchstart"
|
||||
(fn [e]
|
||||
(.stopPropagation e)))
|
||||
|
||||
Reference in New Issue
Block a user