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
|
(mixins/hide-when-esc-or-outside
|
||||||
state
|
state
|
||||||
:on-hide (fn [_state e type]
|
: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!)
|
(mixins/event-mixin setup-key-listener!)
|
||||||
lifecycle/lifecycle
|
lifecycle/lifecycle
|
||||||
[state {:keys [format block parent-block]} id config]
|
[state {:keys [format block parent-block]} id config]
|
||||||
|
@ -871,6 +872,11 @@
|
||||||
:on-click (editor-handler/editor-on-click! id)
|
:on-click (editor-handler/editor-on-click! id)
|
||||||
:on-change (editor-handler/editor-on-change! block id search-timeout)
|
:on-change (editor-handler/editor-on-change! block id search-timeout)
|
||||||
:on-paste (paste-handler/editor-on-paste! id)
|
: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
|
:auto-focus true
|
||||||
:class heading-class}
|
:class heading-class}
|
||||||
(some? parent-block)
|
(some? parent-block)
|
||||||
|
|
Loading…
Reference in New Issue