mirror of https://github.com/logseq/logseq
fix: ESC doesn't exit editor after page autocomplete
parent
0bd6c05e69
commit
a39f19c976
|
@ -855,7 +855,8 @@
|
|||
(mixins/hide-when-esc-or-outside
|
||||
state
|
||||
:on-hide (fn [_state e type]
|
||||
(editor-on-hide state (:value (editor-handler/get-state)) type e)))))
|
||||
(when (not= type :esc)
|
||||
(editor-on-hide state (:value (editor-handler/get-state)) type e))))))
|
||||
(mixins/event-mixin setup-key-listener!)
|
||||
lifecycle/lifecycle
|
||||
[state {:keys [format block parent-block]} id config]
|
||||
|
@ -871,6 +872,11 @@
|
|||
:on-click (editor-handler/editor-on-click! id)
|
||||
:on-change (editor-handler/editor-on-change! block id search-timeout)
|
||||
:on-paste (paste-handler/editor-on-paste! id)
|
||||
:on-key-down (fn [e]
|
||||
(if-let [on-key-down (:on-key-down config)]
|
||||
(on-key-down e)
|
||||
(when (= (util/ekey e) "Escape")
|
||||
(editor-on-hide state content :esc e))))
|
||||
:auto-focus true
|
||||
:class heading-class}
|
||||
(some? parent-block)
|
||||
|
|
Loading…
Reference in New Issue