GitbookIO / GitbookIO/gitbook

Page randomly jumps back to top when scrolling

Open
#2,957 8 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
29k
Forks
4k
Avg merge
1d 2h
Merged PRs (30d)
71

Description

Bug description

After scrolling down, pages will sometimes jump back to the top.

How to reproduce

  1. Load a scrollable page such as https://docs.gitbook.com/creating-content/formatting/inline
  2. X out of the cookies notification
  3. Wait a few seconds
  4. Scroll down.
  5. Observe that the window jumps back to the very top of the page

It happens roughly 25% of the time. If it doesn't happen the first time, navigate to a different page and try again.

We're reproduced on macs, PCs, and across multiple browsers including Chrome and Safari.

Seems to affect all spaces/docs published on gitbook.

Additional context

Screen recording of the issue. It happens on the second attempt.

https://github.com/user-attachments/assets/6c125d5f-62a7-485c-920d-a4401763e3d9

Clients are complaining and blaming us. Please fix.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the jump on the linked GitBook documentation page using the listed steps, and review the attached screen recording. Check whether the behavior occurs across the reported browsers and pages; done means the window no longer returns to the top after dismissing the cookie notification and scrolling.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.