anchorTo: 'end' loses the end when the scroll element shrinks
Les mainteneurs répondent en général sous 1 jour
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 68/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- typescript
- Domaine
- frontend
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Render an end-anchored list and scroll to the end.
- Reduce the scroll element's height, or resize the window when it is sized from the viewport.
- 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.
- Langage dominant
- TypeScript
- Étoiles
- 7.1k
- Forks
- 472
- Merge moyen
- 1 j 1 h
- PR mergées (30 j)
- 11
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de TanStack/virtual
-
measureElement caches 0 size for nodes that aren't attached yet (Vue: rows stack at start 0 and the list scrolls away on mount)Peut-être pris @webn00b l’a pris il y a 13 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
`scrollToIndex(last, { align: 'end' })` stays short of the end after a measured row grows (virtual-core ≥ 3.17.0)Peut-être pris @minwookshin l’a pris il y a 10 jours. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
TanStack/virtual#1290 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
virtual-core: desktop Safari drops the prepend anchor write when history lands during the top rubber-band bouncePeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 38/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 62/100
Les mainteneurs répondent en général sous 1 jour
-
marko-virtual: scrollToEnd during an in-flight prepend strands the view one prepend above the bottom (chat-pretext e2e fails on CI)Peut-être à nouveau libre Une pull request pour cette issue a été fermée sans être fusionnée. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de TanStack/virtual
Issues similaires
-
Mondriaan
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
knaw-huc/textannoviz#709 ·
Les mainteneurs répondent en général sous 1 jour
-
Add: YRF Music NepalOuvertestreams:add
Difficulté 1/5 Moins d'une heure Accessibilité débutants 62/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
walletbeat/walletbeat#1558 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
hawk-digital-environments/HAWKI#438 ·
Les mainteneurs répondent en général sous 1 jour
-
good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
OktoLabsAI/okto-pulse#114 ·
Les mainteneurs répondent en général sous 1 jour