Browse Source

fix: click on page title in query table opens it twice in file graph

fixed https://github.com/logseq/db-test/issues/395
Tienson Qin 4 months ago
parent
commit
474b192027

+ 3 - 1
src/main/frontend/components/block.cljs

@@ -709,7 +709,7 @@
    All page-names are sanitized except page-name-in-block"
   [state
    {:keys [contents-page? whiteboard-page? other-position? show-unique-title?
-           on-context-menu with-parent?]
+           on-context-menu with-parent? stop-event-propagation?]
     :or {with-parent? true}
     :as config}
    page-entity children label]
@@ -734,6 +734,8 @@
        :on-drag-start (fn [e]
                         (editor-handler/block->data-transfer! page-name e true))
        :on-pointer-down (fn [^js e]
+                          (when stop-event-propagation?
+                            (util/stop-propagation e))
                           (cond
                             (util/link? (.-target e))
                             nil

+ 2 - 2
src/main/frontend/components/file_based/query_table.cljs

@@ -173,7 +173,7 @@
     ;; string values will attempt to be rendered as pages, falling back to
     ;; inline-text when no page entity is found
     (string? value) (if-let [page (and (string? value) (db/get-page value))]
-                      (page-cp {} page)
+                      (page-cp {:stop-event-propagation? true} page)
                       (inline-text row-block row-format value))
     ;; anything else should just be rendered as provided
     :else value))
@@ -223,7 +223,7 @@
                                      (state/sidebar-add-block!
                                       (state/get-current-repo)
                                       (:db/id row)
-                                      :block-ref)
+                                      :block)
                                      (reset! *mouse-down? false)))}
                  (when (some? value)
                    (render-column-value {:row-block row

+ 1 - 1
src/main/frontend/components/page.cljs

@@ -646,7 +646,7 @@
                                         :preview? preview?})))
                (lsp-pagebar-slot)])
 
-            (when block?
+            (when (and block? (not sidebar?))
               (component-block/breadcrumb {} repo (:block/uuid page) {}))
 
             (when (and db-based? (ldb/library? page))