mirror of
https://github.com/logseq/logseq.git
synced 2026-05-05 11:26:26 +00:00
fix(editor): invalid editor up/down actions for the selection mode once outdent/indent
This commit is contained in:
@@ -883,10 +883,12 @@
|
||||
(when-let [blocks (if container
|
||||
(get-blocks-noncollapse container)
|
||||
(get-blocks-noncollapse))]
|
||||
(when-let [index (.indexOf blocks block)]
|
||||
(let [idx (dec index)]
|
||||
(when (>= idx 0)
|
||||
(nth-safe blocks idx))))))))
|
||||
(let [block-id (.-id block)
|
||||
block-ids (mapv #(.-id %) blocks)]
|
||||
(when-let [index (.indexOf block-ids block-id)]
|
||||
(let [idx (dec index)]
|
||||
(when (>= idx 0)
|
||||
(nth-safe blocks idx)))))))))
|
||||
|
||||
#?(:cljs
|
||||
(defn get-prev-block-non-collapsed-non-embed
|
||||
@@ -903,11 +905,13 @@
|
||||
#?(:cljs
|
||||
(defn get-next-block-non-collapsed
|
||||
[block]
|
||||
(when-let [blocks (get-blocks-noncollapse)]
|
||||
(when-let [index (.indexOf blocks block)]
|
||||
(let [idx (inc index)]
|
||||
(when (>= (count blocks) idx)
|
||||
(nth-safe blocks idx)))))))
|
||||
(when-let [blocks (and block (get-blocks-noncollapse))]
|
||||
(let [block-id (.-id block)
|
||||
block-ids (mapv #(.-id %) blocks)]
|
||||
(when-let [index (.indexOf block-ids block-id)]
|
||||
(let [idx (inc index)]
|
||||
(when (>= (count blocks) idx)
|
||||
(nth-safe blocks idx))))))))
|
||||
|
||||
#?(:cljs
|
||||
(defn get-next-block-non-collapsed-skip
|
||||
|
||||
Reference in New Issue
Block a user