소스 검색

Merge branch 'feat/db' of https://github.com/logseq/logseq into feat/db

charlie 7 달 전
부모
커밋
4268cba686
3개의 변경된 파일11개의 추가작업 그리고 8개의 파일을 삭제
  1. 1 7
      src/main/frontend/components/editor.cljs
  2. 4 1
      src/main/frontend/components/property.cljs
  3. 6 0
      src/main/frontend/handler/editor.cljs

+ 1 - 7
src/main/frontend/components/editor.cljs

@@ -34,7 +34,6 @@
             [logseq.db :as ldb]
             [logseq.db.frontend.class :as db-class]
             [logseq.graph-parser.property :as gp-property]
-            [logseq.shui.popup.core :as shui-popup]
             [logseq.shui.ui :as shui]
             [promesa.core :as p]
             [react-draggable]
@@ -635,11 +634,6 @@
          [:span {:id (str "mock-text_" idx)
                  :key idx} c])))])
 
-(defn- exist-editor-commands-popup?
-  []
-  (some->> (shui-popup/get-popups)
-           (some #(some-> % (:id) (str) (string/starts-with? ":editor.commands")))))
-
 (defn- open-editor-popup!
   [id content opts]
   (let [input (state/get-input)
@@ -735,7 +729,7 @@
   (let [action (state/get-editor-action)
         [_id config] (:rum/args state)]
     (cond
-      (and (= type :esc) (exist-editor-commands-popup?))
+      (and (= type :esc) (editor-handler/editor-commands-popup-exists?))
       nil
 
       (or (contains?

+ 4 - 1
src/main/frontend/components/property.cljs

@@ -138,7 +138,10 @@
       (shui/select-content
        (shui/select-group
         (for [{:keys [label value disabled]} schema-types]
-          (shui/select-item {:key label :value value :disabled disabled} label)))))
+          (shui/select-item {:key label :value value :disabled disabled
+                             :on-key-down (fn [e]
+                                            (when (= "Enter" (.-key e))
+                                              (util/stop-propagation e)))} label)))))
      (when show-type-change-hints?
        (ui/tippy {:html        "Changing the property type clears some property configurations."
                   :class       "tippy-hover ml-2"

+ 6 - 0
src/main/frontend/handler/editor.cljs

@@ -65,6 +65,7 @@
             [logseq.graph-parser.utf8 :as utf8]
             [logseq.outliner.core :as outliner-core]
             [logseq.outliner.property :as outliner-property]
+            [logseq.shui.popup.core :as shui-popup]
             [promesa.core :as p]
             [rum.core :as rum]))
 
@@ -3394,6 +3395,11 @@
           (cursor/select-up-down input direction anchor cursor-rect)))
       (select-block-up-down direction))))
 
+(defn editor-commands-popup-exists?
+  []
+  (some->> (shui-popup/get-popups)
+           (some #(some-> % (:id) (str) (string/starts-with? ":editor.commands")))))
+
 (defn open-selected-block!
   [direction e]
   (let [selected-blocks (state/get-selection-blocks)