Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Layout breaks when changing lanes option with measureElement used

Geschlossen
#1,036 0 Kommentare 7 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
typescript
Bereich
frontend

Rechercherichtung

Beginne mit der verlinkten CodeSandbox-Reproduktion und verfolge den useVirtualizer-Pfad, der measureElement, dynamische lanes und zwischengespeicherte Elementmessungen umfasst. Reproduziere den Fehler, indem du bis zum Ende scrollst, die lanes von 10 auf 5 änderst, und bestätige, dass das Layout die Positionen neu berechnet, ohne falsch positionierte Elemente oder leere Bereiche.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Describe the bug

When using measureElement with useVirtualizer, changing the number of lanes dynamically causes the layout to break.
The virtualizer calculates incorrect ranges for items with indices beyond the visible range, resulting in mispositioned items or empty spaces.

Your minimal, reproducible example

https://codesandbox.io/p/devbox/tankstack-virtual-range-extractor-forked-wlddzn?workspaceId=ws_NvUKNhUDiFBCs4Fb9Zkkhb

Steps to reproduce
  1. Scroll to the end of the list (so that only higher-index items are rendered).
  2. Change the number of lanes from 10 to 5 dynamically.
Expected behavior
  • The virtualizer should correctly invalidate cached measurements for all items and recalculate their positions when the number of lanes changes.
  • The layout should adjust seamlessly after changing lanes.
How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

Any platform

tanstack-virtual version

3.13.12

TypeScript version

5.2.2

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.
Vorherrschende Sprache
TypeScript
Sterne
7.1k
Forks
478
Ø Merge
1 T. 2 Std.
Gemergte PRs (30 T.)
34

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus TanStack/virtual

Alle Issues in TanStack/virtual

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.