From 88a13ba2f8f5b37a5feafb364d9080ed47e308a5 Mon Sep 17 00:00:00 2001 From: Philipp Markovics Date: Mon, 28 Jan 2019 12:59:50 +0100 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20follow=20links=20when=20they=20?= =?UTF-8?q?are=20contenteditable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/reitit-frontend/src/reitit/frontend/history.cljs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/reitit-frontend/src/reitit/frontend/history.cljs b/modules/reitit-frontend/src/reitit/frontend/history.cljs index 35d8a091..2fd5da1e 100644 --- a/modules/reitit-frontend/src/reitit/frontend/history.cljs +++ b/modules/reitit-frontend/src/reitit/frontend/history.cljs @@ -2,7 +2,8 @@ (:require [reitit.core :as reitit] [reitit.core :as r] [reitit.frontend :as rf] - [goog.events :as gevents]) + [goog.events :as gevents] + [goog.dom :as gdom]) (:import goog.Uri)) (defprotocol History @@ -75,7 +76,8 @@ (not (contains? #{"_blank" "self"} (.getAttribute el "target"))) ;; Left button (= 0 (.-button e)) - (reitit/match-by-path router (.getPath uri))) + (reitit/match-by-path router (.getPath uri)) + (not (gdom/getAncestor el (fn [node] (.isContentEditable node))))) (.preventDefault e) (let [path (str (.getPath uri) (if (seq (.getQuery uri))