back/forward scroll restoration lands clamped to the outgoing page

Open
#2,079 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
react, typescript
Domain
frontend

Research direction

The custom helper is src/layout/scroll-to-top.tsx; find where the webui mounts declarative <BrowserRouter>. Migrate the default app to createBrowserRouter plus RouterProvider and mount first-party <ScrollRestoration/> so restore runs after the destination commits. Swap forward-link preserveScroll for built-in preventScrollReset and remove the custom component. Done when back/forward from a short page to a long scrolled list lands at the stored offset.

Written by the indexing model from the issue text.

Description

bug webui

The webui uses the declarative <BrowserRouter>, leaving back/forward scroll restoration to the browser (a small custom component, src/layout/scroll-to-top.tsx, only covers scroll-to-top on forward navigation, which the declarative router does not provide). The limitation: on a same-document pop the browser restores the stored offset synchronously at popstate, while the outgoing page is still in the DOM — react-router v7 commits the new location inside startTransition a frame later — so the landing position is clamped to the outgoing page's height and never corrected. Navigating back from a short page to a long, deeply scrolled list therefore lands well above where the user left, and no layout work can fix it since the destination is not rendered when the browser restores.

The intended fix is migrating the default app to a data router (createBrowserRouter + RouterProvider) and mounting react-router's first-party <ScrollRestoration/>, which restores after the destination commits; that also replaces the custom component (forward links switch from the preserveScroll state to the built-in preventScrollReset).

Dominant language
Java
Stars
2.1k
Forks
362
Avg merge
1d 3h
Merged PRs (30d)
44

Getting set up

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.

More from eclipse-openvsx/openvsx

All issues in eclipse-openvsx/openvsx

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.