I have just released a tiny library that manages scroll positioning for ClojureScript SPAs. I call it Clerk.

GitHub PEZ/clerk In-page navigation (scrolling) for ClojureScript SPAs. - PEZ/clerk

It solves a problem with Single Page Applications that want to behave like ”regular” sites do, i.e. what the user perceives as new pages are just content changing in the current page and without attention to this the scroll position will remain when navigating to new ”pages”:

or strange things will happen when navigating the browser history within the SPA.

The core design of Clerk is tried and tested in the project I work on for a living. Even if the API and packaging is freshly made and you can expect some bugs in this first release. I would love me some feedback!

Note that if you want to try out Clerk’s support for navigation to in-page anchor targets you should not use Secretary, because it does not really support it. Bidi does, however, so you can try it out with that.

EDIT: Online demo here: https://clerk-demo.netlify.com/