From 572602f0b3d79546c89e79c649f4c15ee4d5b9e4 Mon Sep 17 00:00:00 2001 From: bplubell Date: Fri, 16 Jan 2026 10:15:54 -0800 Subject: [PATCH] Skip on-click handling in contenteditable areas Default browser behavior is to NOT navigate to links that are marked as editable. Previously, links inside contenteditable areas that did not pass the conditions in the on-click handler (e.g. if they had a scheme and different origin) would behave as expected. However, links that did pass the conditions (e.g. if they were relative) would navigate, which does not match browser default behavior. Notably, elements inside of a
may be override that, making them un-editable. When a link does that, the browser *does* navigate. This change will also navigate, mimicking browser behavior as expected. --- src/pushy/core.cljs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pushy/core.cljs b/src/pushy/core.cljs index fafff0f..b77633b 100644 --- a/src/pushy/core.cljs +++ b/src/pushy/core.cljs @@ -123,7 +123,9 @@ (or (not (.hasAttribute el "data-pushy-ignore")) (= (.getAttribute el "data-pushy-ignore") "false")) ;; Only dispatch on left button click - (= 0 (.-button e))) + (= 0 (.-button e)) + ;; Bypass if is meant to be editable + (not (.-isContentEditable el))) (let [next-token (get-token-from-uri uri)] (if (identity-fn (match-fn next-token)) ;; Dispatch!