mirror of https://github.com/logseq/logseq
fix app crash if swiped block and editing block are different
parent
328fda29a9
commit
13cc487592
|
@ -2467,7 +2467,7 @@
|
|||
|
||||
[:div.flex.flex-row.pr-2
|
||||
{:class (if (and heading? (seq (:block/title block))) "items-baseline" "")
|
||||
:on-touch-start block-handler/on-touch-start
|
||||
:on-touch-start (fn [event uuid] (block-handler/on-touch-start event uuid))
|
||||
:on-touch-move (fn [event]
|
||||
(block-handler/on-touch-move event block uuid edit? *show-left-menu? *show-right-menu?))
|
||||
:on-touch-end (fn [event]
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
(ns frontend.handler.block
|
||||
(:require
|
||||
[clojure.set :as set]
|
||||
[clojure.string :as string]
|
||||
[clojure.walk :as walk]
|
||||
[frontend.db :as db]
|
||||
[frontend.db.model :as db-model]
|
||||
|
@ -149,8 +150,12 @@
|
|||
(def *swipe (atom nil))
|
||||
|
||||
(defn on-touch-start
|
||||
[event]
|
||||
(let [input (state/get-input)]
|
||||
[event uuid]
|
||||
(let [input (state/get-input)
|
||||
input-id (state/get-edit-input-id)]
|
||||
(when-not (and input
|
||||
(string/ends-with? input-id (str uuid)))
|
||||
(state/clear-edit!))
|
||||
(when (= (util/get-selection-start input)
|
||||
(util/get-selection-end input))
|
||||
(when-let [touches (.-targetTouches event)]
|
||||
|
|
Loading…
Reference in New Issue