mirror of https://github.com/logseq/logseq
refactor: make-el-into-viewport
parent
717fdb5940
commit
fc8d2727d1
|
@ -23,7 +23,7 @@
|
|||
(.focus element)
|
||||
(when (or (mobile-util/is-native-platform?)
|
||||
(util/mobile?))
|
||||
(util/make-el-into-viewport element 60))))
|
||||
(util/make-el-into-viewport element))))
|
||||
state)
|
||||
|
||||
(defn did-remount!
|
||||
|
|
|
@ -229,7 +229,7 @@
|
|||
|
||||
(defmethod handle :mobile/keyboard-did-show [[_]]
|
||||
(when-let [input (state/get-input)]
|
||||
(util/make-el-into-viewport input 60)))
|
||||
(util/make-el-into-viewport input)))
|
||||
|
||||
(defn run!
|
||||
[]
|
||||
|
|
|
@ -289,4 +289,4 @@
|
|||
(when-let [input (state/get-input)]
|
||||
(if (or (mobile/is-native-platform?)
|
||||
(util/mobile?))
|
||||
(util/make-el-into-viewport input 60))))
|
||||
(util/make-el-into-viewport input))))
|
||||
|
|
|
@ -1490,6 +1490,8 @@
|
|||
|
||||
#?(:cljs
|
||||
(defn make-el-into-viewport
|
||||
([^js/HTMLElement el]
|
||||
(make-el-into-viewport el 60))
|
||||
([^js/HTMLElement el offset]
|
||||
(make-el-into-viewport el offset true))
|
||||
([^js/HTMLElement el offset async?]
|
||||
|
@ -1511,14 +1513,14 @@
|
|||
|
||||
#?(:cljs
|
||||
(defn event-is-composing?
|
||||
"Check if keydown event is a composing (IME) event.
|
||||
"Check if keydown event is a composing (IME) event.
|
||||
Ignore the IME process by default."
|
||||
([e]
|
||||
(event-is-composing? e false))
|
||||
([e include-process?]
|
||||
(let [event-composing? (gobj/getValueByKeys e "event_" "isComposing")]
|
||||
(if include-process?
|
||||
(or event-composing?
|
||||
(or event-composing?
|
||||
(= (gobj/get e "keyCode") 229)
|
||||
(= (gobj/get e "key") "Process"))
|
||||
event-composing?)))))
|
||||
|
|
Loading…
Reference in New Issue