mirror of https://github.com/logseq/logseq
fix(editor): avoid select-all while editing title
parent
7c76dcb2cf
commit
94d75b80bc
|
@ -3426,7 +3426,8 @@
|
||||||
|
|
||||||
(defn select-parent [e]
|
(defn select-parent [e]
|
||||||
(let [edit-input (some-> (state/get-edit-input-id) gdom/getElement)
|
(let [edit-input (some-> (state/get-edit-input-id) gdom/getElement)
|
||||||
edit-block (state/get-edit-block)]
|
edit-block (state/get-edit-block)
|
||||||
|
target-element (.-nodeName (.-target e))]
|
||||||
(cond
|
(cond
|
||||||
;; editing block fully selected
|
;; editing block fully selected
|
||||||
(and edit-block edit-input
|
(and edit-block edit-input
|
||||||
|
@ -3439,6 +3440,10 @@
|
||||||
edit-block
|
edit-block
|
||||||
nil
|
nil
|
||||||
|
|
||||||
|
;; Focusing other input element, e.g. when editing page title.
|
||||||
|
(contains? #{"INPUT" "TEXTAREA"} target-element)
|
||||||
|
nil
|
||||||
|
|
||||||
:else
|
:else
|
||||||
(do
|
(do
|
||||||
(util/stop e)
|
(util/stop e)
|
||||||
|
|
|
@ -953,7 +953,7 @@ Similar to re-frame subscriptions"
|
||||||
(set-selection-blocks! blocks :down))
|
(set-selection-blocks! blocks :down))
|
||||||
([blocks direction]
|
([blocks direction]
|
||||||
(when (seq blocks)
|
(when (seq blocks)
|
||||||
(let [blocks (util/sort-by-height blocks)]
|
(let [blocks (util/sort-by-height (remove nil? blocks))]
|
||||||
(swap! state assoc
|
(swap! state assoc
|
||||||
:selection/mode true
|
:selection/mode true
|
||||||
:selection/blocks blocks
|
:selection/blocks blocks
|
||||||
|
|
Loading…
Reference in New Issue