Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scroll position lost after browser refresh / error popup #645

Open
yuhan0 opened this issue Apr 7, 2024 · 0 comments
Open

Scroll position lost after browser refresh / error popup #645

yuhan0 opened this issue Apr 7, 2024 · 0 comments

Comments

@yuhan0
Copy link

yuhan0 commented Apr 7, 2024

Repro:

  • Have clerk show the following file on a small browser window such that it doesn't fit on a single page, and scroll to the bottom where the assoc block is visible.
(ns repro.scroll
  (:require [nextjournal.clerk :as clerk]))

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

(assoc {:current :position}
       :in :document
       ;; whoops
       )
       
(comment
  (clerk/show! *ns*))
  • Pretend to have made an error while editing the document by uncommenting the ;;whoops line
  • Save and eval clerk/show!
  • Browser page transforms into lots of scary red stacktraces
  • Fix the error by commenting the line back out.

Expected:

  • Last scroll position is preserved, such that the 'current' block being worked on remains visible.

Actual:

  • Scroll position is reset to top of page , user has to manually scroll back to where they were (usually at the bottom of a file)

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant