laneAssignmentMode 'measured': is it intended that a row measured at exactly its estimate can change lanes?
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
- 55/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- react, typescript
- Bereich
- frontend
Rechercherichtung
Start in tests/index.test.ts, which the issue names as the place that reads the private measurement method, and trace how resizeItem handles sizes equal to estimateSize in measured lane assignment. Add a regression case based on the reproducer, then check whether lanes remain stable after row 1 grows; the issue leaves the intended behavior unresolved, so confirm that before changing behavior.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Describe the bug
With lanes > 1 and laneAssignmentMode: 'measured', a row whose first measurement exactly equals estimateSize doesn't get its lane cached, because resizeItem records a measurement only when the size changes. When a row above it grows later, that row is placed again and can move to another lane. A row measured at any other size keeps its lane.
Your minimal, reproducible example
import { Virtualizer } from '@tanstack/virtual-core'
const measureThenGrow = (height: number) => {
const virtualizer = new Virtualizer({
count: 8,
lanes: 2,
estimateSize: () => 100,
laneAssignmentMode: 'measured',
getScrollElement: () => null,
scrollToFn: () => {},
observeElementRect: () => {},
observeElementOffset: () => {},
})
// getMeasurements is private; tests/index.test.ts reads it the same way.
const lanes = () =>
virtualizer['getMeasurements']().map((m) => m.lane).join(' ')
lanes() // Build the measurements first; resizeItem needs them.
for (let i = 0; i < 8; i++) virtualizer.resizeItem(i, height)
const measured = lanes()
virtualizer.resizeItem(1, 500)
return { measured, grown: lanes() }
}
console.log(measureThenGrow(100))
// { measured: '0 1 0 1 0 1 0 1', grown: '0 1 0 0 0 0 1 0' }
console.log(measureThenGrow(101))
// { measured: '0 1 0 1 0 1 0 1', grown: '0 1 0 1 0 1 0 1' }
Steps to reproduce
- Run the example above.
- At 100, row 1 growing moves rows 3, 5, 6 and 7 to another lane.
- At 101, every row keeps its lane.
Expected behavior
I can't tell which behavior is intended, so I'd like to ask before going further.
- If this is not intended, a row measured at exactly its estimate should keep its lane like any other measured row, since the docs say lanes are cached and remain stable after the initial measurement. #1377 is a draft of that fix.
- If this is intended, for example so that a placeholder sized like the estimate can rebalance once its content loads, there is nothing to fix and I'll close #1377.
Is this behavior intended?
How often does this bug happen?
Every time
Platform
Any. This is in virtual-core.
tanstack-virtual version
3.19.11
TypeScript version
n/a
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliably 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
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus TanStack/virtual
-
With `useScrollendEvent`, scrollToIndex and scrollToEnd stop short when the target moves while they settleEvtl. vergeben @Darkatse hat das vor 8 Tagen übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
Maintainer antworten meist innerhalb von 1 Tag
-
svelte-virtual renders no rows when the scroll element is bound after the store subscribesEvtl. vergeben @clean99 hat das vor 13 Tagen übernommen. Offen
Schwierigkeit 4/5 1-2 Tage Anfängerfreundlichkeit 35/100
Maintainer antworten meist innerhalb von 1 Tag
-
anchorTo: 'end' does not keep the reading position when only paddingStart changesEvtl. vergeben @duongynhi000001-crypto hat das vor 12 Tagen übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 30/100
Maintainer antworten meist innerhalb von 1 Tag
-
anchorTo: 'end' loses the end when the scroll element shrinksEvtl. vergeben @langleyd hat das vor 41 Tagen übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
marko-virtual: scrollToEnd during an in-flight prepend strands the view one prepend above the bottom (chat-pretext e2e fails on CI)Evtl. vergeben @officialasishkumar hat das vor 15 Tagen übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in TanStack/virtual
Ähnliche Issues
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 83/100
gofish-graphics/gofish-graphics#1384 ·
Maintainer antworten meist innerhalb von 1 Tag
-
adapter bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
Olanetsoft/agent-lookout#353 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
vicharanashala/vibe#1542 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug chore P2 size:XS
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
josephfung/curia#2666 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
devarshishimpi/codra#178 ·
Maintainer antworten meist innerhalb von 1 Tag