Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

anchorTo: 'end' loses the end when the scroll element shrinks

Aperta
#1,297 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@langleyd ci sta già lavorando.

Dal 7/10/2026.

  • #1298 di @langleyd — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
frontend

Direzione di ricerca

Start in packages/virtual-core where anchorTo: 'end' scroll adjustments and the resize handling live, and compare how an item growing is compensated versus how scroll-element size changes are handled. Reproduce using the chat e2e page in packages/react-virtual/e2e/app/chat/main.tsx on branch langleyd/virtual:fix/end-anchor-scroll-element-resize, which has a control that shrinks the container. Done means an end-pinned viewport stays pinned after the container shrinks, verified by the existing e2e suite plus a new case for container resize.

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

Descrizione

Describe the bug

With anchorTo: 'end', a viewport pinned to the end stays pinned when the last item grows, but not when the scroll element itself gets shorter, for example when the window is resized or the app changes the element's height. The browser keeps scrollTop, so the newest items end up below the fold by the amount the element shrank.

In a chat application this be an element being displayed on the page(say a banner above or below the scroll element) that causes the scroll element to shrink. The effect being the users losing the their place and not seeing the most recent message.

Your minimal, reproducible example

The chat e2e page on langleyd/virtual, branch fix/end-anchor-scroll-element-resize, has a control that shrinks the scroll container: packages/react-virtual/e2e/app/chat/main.tsx.

Steps to reproduce
  1. Render an end-anchored list and scroll to the end.
  2. Reduce the scroll element's height, or resize the window when it is sized from the viewport.
  3. The last items are now below the fold.
Expected behavior

An end-pinned viewport stays pinned to the end, as it does when an item grows.

How often does this bug happen?

Every time

Screenshots or Videos
Currently

https://github.com/user-attachments/assets/d420fad5-7bef-426e-9d10-f72125c80fbf

Expected

https://github.com/user-attachments/assets/58152695-83aa-4da8-9e49-12c422de0499

Platform

any browser. Seen in Chrome on macOS.

tanstack-virtual version

3.17.11

TypeScript version

No response

Additional context

No response

Terms & Code of Conduct
  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
Lingua principale
TypeScript
Stelle
7.1k
Fork
472
Merge medio
1g 1h
PR unite (30g)
11

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 TanStack/virtual

Tutte le issue di TanStack/virtual

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.