mirror of
https://github.com/logseq/logseq.git
synced 2026-05-02 09:56:31 +00:00
fix(iOS): empty block can't be backspace deleted
close https://github.com/logseq/logseq/issues/3648
This commit is contained in:
@@ -56,7 +56,8 @@
|
||||
[lambdaisland.glogi :as log]
|
||||
[medley.core :as medley]
|
||||
[promesa.core :as p]
|
||||
[frontend.util.keycode :as keycode]))
|
||||
[frontend.util.keycode :as keycode]
|
||||
[frontend.mobile.util :as mobile-util]))
|
||||
|
||||
;; FIXME: should support multiple images concurrently uploading
|
||||
|
||||
@@ -2956,6 +2957,16 @@
|
||||
(or ctrlKey metaKey)
|
||||
nil
|
||||
|
||||
;; FIXME: On iOS, a backspace click to call keydown-backspace-handler
|
||||
;; does not work sometimes in an empty block, hence the empty block
|
||||
;; can't be deleted. Need to figure out why and find a better solution.
|
||||
(and (mobile-util/native-ios?)
|
||||
(= key "Backspace")
|
||||
(= value ""))
|
||||
(do
|
||||
(util/stop e)
|
||||
(delete-block! (state/get-current-repo) false))
|
||||
|
||||
(and (= key "#")
|
||||
(and
|
||||
(> pos 0)
|
||||
|
||||
Reference in New Issue
Block a user