mirror of https://github.com/logseq/logseq
fix: mobile app crashes while trying to swipe the block that has any collapsed block (#9154)
parent
beb02b6028
commit
67fe5dc5a7
|
@ -39,9 +39,12 @@
|
|||
(when-let [block (state/sub :mobile/actioned-block)]
|
||||
(let [{:block/keys [uuid children]} block
|
||||
last-child-block-id (when-not (empty? children)
|
||||
(-> (db/get-block-children (state/get-current-repo) uuid)
|
||||
last
|
||||
:block/uuid))]
|
||||
(->> (db/get-block-children (state/get-current-repo) uuid)
|
||||
(filter #(not (db/parents-collapsed? (state/get-current-repo) (:block/uuid %1)))) ;; DOM nodes of blocks the have collapsed parents have no bounding client rect
|
||||
last
|
||||
:block/uuid))]
|
||||
|
||||
;; scroll to the most bottom element of the selected block
|
||||
(let [tag-id (or last-child-block-id uuid)
|
||||
bottom-el (gdom/getElement (str "block-content-" tag-id))
|
||||
bottom (gobj/get (.getBoundingClientRect bottom-el) "bottom")
|
||||
|
|
Loading…
Reference in New Issue