nextjournal / clerk

⚡️ Moldable Live Programming for Clojure
https://clerk.vision
ISC License
1.74k stars 75 forks source link

Scroll position lost after browser refresh / error popup #645

Open yuhan0 opened 2 months ago

yuhan0 commented 2 months ago

Repro:

(ns repro.scroll
  (:require [nextjournal.clerk :as clerk]))

:long
:document
:with
:lots
:of
:cells

(assoc {:current :position}
       :in :document
       ;; whoops
       )

(comment
  (clerk/show! *ns*))

Expected:

Actual:

Additional notes:

Scroll position should also be restored after showing a different namespace and returning back to the original, or after manually refreshing the page. (note that most websites display this behaviour)