mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
fix(editor): events conflicts
This commit is contained in:
@@ -9,7 +9,8 @@
|
||||
[cljs-time.core :as t]
|
||||
[frontend.ui :as ui]
|
||||
[frontend.commands :as commands]
|
||||
[clojure.string :as string]))
|
||||
[clojure.string :as string]
|
||||
[frontend.mixins :as mixins]))
|
||||
|
||||
(defonce default-timestamp-value {:date nil
|
||||
:time ""
|
||||
|
||||
@@ -495,7 +495,7 @@
|
||||
(let [input-id (state/get-edit-input-id)
|
||||
input (and input-id (gdom/getElement id))
|
||||
pos (and input (:pos (util/get-caret-pos input)))]
|
||||
(when-not (state/get-editor-show-input)
|
||||
(when (not @commands/*current-command)
|
||||
(util/stop e)
|
||||
(let [direction (if (gobj/get e "shiftKey") ; shift+tab move to left
|
||||
:left
|
||||
@@ -596,19 +596,8 @@
|
||||
(let [matched-commands (editor-handler/get-matched-commands input)]
|
||||
(if (seq matched-commands)
|
||||
(do
|
||||
(cond
|
||||
(= key-code 9) ;tab
|
||||
(when @*show-commands
|
||||
(util/stop e)
|
||||
(editor-handler/insert-command! input-id
|
||||
(last (first matched-commands))
|
||||
format
|
||||
nil))
|
||||
|
||||
:else
|
||||
(do
|
||||
(reset! *show-commands true)
|
||||
(reset! *matched-commands matched-commands))))
|
||||
(reset! *show-commands true)
|
||||
(reset! *matched-commands matched-commands))
|
||||
(reset! *show-commands false))))
|
||||
(when (and @*show-block-commands (not= key-code 188)) ; not <
|
||||
(let [matched-block-commands (editor-handler/get-matched-block-commands input)]
|
||||
|
||||
@@ -221,7 +221,8 @@
|
||||
(when-not (input-or-select?)
|
||||
(swap! *internal-model inc-week 1)))}
|
||||
{:all-handler (fn [e key-code]
|
||||
(when (contains? #{13} key-code)
|
||||
(when (and (contains? #{13 37 39 38 40} key-code)
|
||||
(not deadline-or-schedule?))
|
||||
(util/stop e)))}))))
|
||||
{:init (fn [state]
|
||||
(reset! *internal-model (first (:rum/args state)))
|
||||
|
||||
Reference in New Issue
Block a user