Skip to content

Commit

Permalink
Do not handle clicks on ToC links with default handler
Browse files Browse the repository at this point in the history
  • Loading branch information
zampino committed Sep 11, 2023
1 parent 9f336d7 commit 617ddc1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/nextjournal/clerk/render/navbar.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
[_ hash] (some-> search (.split "#"))]
(when (or (and search hash (= path-name current-path-name)) anchor-only?)
(let [anchor (if anchor-only? path-name (str "#" hash))]
(.stopPropagation event)
(.preventDefault event)
(when set-hash?
(.pushState js/history #js {} "" anchor))
Expand Down

0 comments on commit 617ddc1

Please sign in to comment.