mirror of
https://github.com/metosin/reitit.git
synced 2025-12-17 08:21:11 +00:00
Merge pull request #212 from nextjournal/fix-html5-history-contenteditable
Fix handling links inside contenteditable
This commit is contained in:
commit
f5eb1d17f5
1 changed files with 4 additions and 2 deletions
|
|
@ -4,7 +4,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
|
||||
|
|
@ -77,7 +78,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))
|
||||
|
|
|
|||
Loading…
Reference in a new issue