|
|
@@ -743,9 +743,9 @@
|
|
|
(shui-editor-popups id format action nil)))
|
|
|
|
|
|
(defn- editor-on-hide
|
|
|
- [state type e]
|
|
|
+ [state type e editing-another-block?]
|
|
|
(let [action (state/get-editor-action)
|
|
|
- [_id config] (:rum/args state)]
|
|
|
+ [opts _id config] (:rum/args state)]
|
|
|
(cond
|
|
|
(and (= type :esc) (editor-handler/editor-commands-popup-exists?))
|
|
|
nil
|
|
|
@@ -771,7 +771,8 @@
|
|
|
(when-let [container (gdom/getElement "app-container")]
|
|
|
(dom/remove-class! container "blocks-selection-mode"))
|
|
|
(p/do!
|
|
|
- (editor-handler/escape-editing {:select? select?})
|
|
|
+ (editor-handler/escape-editing {:select? select?
|
|
|
+ :editing-another-block? editing-another-block?})
|
|
|
(some-> config :on-escape-editing
|
|
|
(apply [(str uuid) (= type :esc)])))))))
|
|
|
|
|
|
@@ -793,7 +794,8 @@
|
|
|
{:node @(::ref state)
|
|
|
:on-hide (fn [_state e type]
|
|
|
(when-not (= type :esc)
|
|
|
- (editor-on-hide state type e)))})))
|
|
|
+ (let [editing-another-block? (.closest (.-target e) ".ls-block")]
|
|
|
+ (editor-on-hide state type e editing-another-block?))))})))
|
|
|
(mixins/event-mixin setup-key-listener!)
|
|
|
lifecycle/lifecycle
|
|
|
[state {:keys [format block parent-block]} id config]
|
|
|
@@ -813,7 +815,7 @@
|
|
|
(if-let [on-key-down (:on-key-down config)]
|
|
|
(on-key-down e)
|
|
|
(when (= (util/ekey e) "Escape")
|
|
|
- (editor-on-hide state :esc e))))
|
|
|
+ (editor-on-hide state :esc e false))))
|
|
|
:auto-focus true
|
|
|
:auto-capitalize (if (util/mobile?) "sentences" "off")
|
|
|
:auto-correct (if (util/mobile?) "true" "false")
|