back/forward scroll restoration lands clamped to the outgoing page

Aperta
#2,079 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
react, typescript
Ambito
frontend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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).

Lingua principale
Java
Stelle
2.1k
Fork
362
Merge medio
1g 3h
PR unite (30g)
44

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di eclipse-openvsx/openvsx

Tutte le issue di eclipse-openvsx/openvsx

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.