Prechádzať zdrojové kódy

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 6 mesiacov pred
rodič
commit
dcc2e9d374
1 zmenil súbory, kde vykonal 5 pridanie a 1 odobranie
  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