Expanding rows in a virtualized table will cause it to scroll to top

Offen
#656 7 Kommentare 9 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
58/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Ruhig
Tech-Stack
typescript
Bereich
frontend

Rechercherichtung

Reproduziere das Verhalten anhand des verlinkten StackBlitz-Beispiels, beginnend mit src/App.svelte und der Behandlung der Zeilenerweiterung der virtualisierten Tabelle. Überprüfe, dass das Umschalten einer erweiterten Zeile nach dem Scrollen die aktuelle Scrollposition beibehält, anstatt zum Anfang zurückzukehren, und füge einen Regressionstest hinzu oder aktualisiere ihn, falls das Repository einen bereitstellt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Describe the bug

When implementing expandable rows in a virtualized table, toggling an expandable row will immediately cause the table to scroll to top regardless of where the the current scroll offset is.

Your minimal, reproducible example

https://stackblitz.com/edit/tanstack-virtual-xdmecx?file=src%2FApp.svelte

Steps to reproduce
  1. Scroll down table.
  2. Toggle on/off an expandable row.
  3. Table will immediately scroll to top.
Expected behavior

I expect to be able to toggle an expandable row and still be able to see it in it's current scroll position. Instead, It scrolls all the way to the top.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

MacOS, Brave browser v1.62.153

tanstack-virtual version

3.0.2

TypeScript version

^5.0.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.2k
Forks
495
Ø Merge
23 Std. 16 Min.
Gemergte PRs (30 T.)
19

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.