mirror of
https://github.com/logseq/logseq.git
synced 2026-05-02 09:56:31 +00:00
fix: text goes beneath toolbar in large block on iOS (#4179)
* fix(mobile): text goes beneath toolbar in large block Co-authored-by: leizhe <leizhe@leizhedeMacBook-Air.local> Co-authored-by: Andelf <andelf@gmail.com>
This commit is contained in:
@@ -3116,6 +3116,20 @@
|
||||
(let [input (gdom/getElement id)]
|
||||
(close-autocomplete-if-outside input))))
|
||||
|
||||
(defn editor-on-height-change!
|
||||
[id]
|
||||
(fn [row-height]
|
||||
(let [input (gdom/getElement id)
|
||||
top (gobj/get (.getBoundingClientRect input) "top")
|
||||
cursor-y (+ top row-height)
|
||||
vw-height (.-height js/window.visualViewport)]
|
||||
;; 40 is mobile toolbar height
|
||||
(when (< vw-height (+ cursor-y 40))
|
||||
(let [main-node (gdom/getElement "main-content-container")
|
||||
scroll-top (.-scrollTop main-node)]
|
||||
;; 24 is default line height
|
||||
(set! (.-scrollTop main-node) (+ scroll-top 24)))))))
|
||||
|
||||
(defn editor-on-change!
|
||||
[block id search-timeout]
|
||||
(fn [e]
|
||||
|
||||
Reference in New Issue
Block a user