Browse Source

fix: click a link in node reference opens the node

The expected behavior is to open the link and not redirect to the
referenced node.
Tienson Qin 4 months ago
parent
commit
dcc2e9d374
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/main/frontend/components/block.cljs

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

@@ -687,9 +687,13 @@
        :on-mouse-over #(reset! *hover? true)
        :on-mouse-leave #(reset! *hover? false)
        :on-click (fn [e]
-                   (when stop-click-event? (util/stop e)))
+                   (when (and stop-click-event? (not (util/link? (.-target e))))
+                     (util/stop e)))
        :on-pointer-down (fn [^js e]
                           (cond
+                            (util/link? (.-target e))
+                            nil
+
                             (and on-context-menu (= 2 (.-button e)))
                             nil