diff --git a/src/main/frontend/handler/editor.cljs b/src/main/frontend/handler/editor.cljs index a9cee79f4..621189277 100644 --- a/src/main/frontend/handler/editor.cljs +++ b/src/main/frontend/handler/editor.cljs @@ -3426,7 +3426,8 @@ (defn select-parent [e] (let [edit-input (some-> (state/get-edit-input-id) gdom/getElement) - edit-block (state/get-edit-block)] + edit-block (state/get-edit-block) + target-element (.-nodeName (.-target e))] (cond ;; editing block fully selected (and edit-block edit-input @@ -3439,6 +3440,10 @@ edit-block nil + ;; Focusing other input element, e.g. when editing page title. + (contains? #{"INPUT" "TEXTAREA"} target-element) + nil + :else (do (util/stop e) diff --git a/src/main/frontend/state.cljs b/src/main/frontend/state.cljs index 0ca01894f..87719fc92 100644 --- a/src/main/frontend/state.cljs +++ b/src/main/frontend/state.cljs @@ -953,7 +953,7 @@ Similar to re-frame subscriptions" (set-selection-blocks! blocks :down)) ([blocks direction] (when (seq blocks) - (let [blocks (util/sort-by-height blocks)] + (let [blocks (util/sort-by-height (remove nil? blocks))] (swap! state assoc :selection/mode true :selection/blocks blocks