Skip to content
Source
Sign inSign up
TanStack/virtual

refactor(virtual-core): describe an in-flight scroll command by one phase #1311

Mergedpiecykmerged 3 commits intomain fromrefs/pull/1311/headmerged by piecyk

Showing 4 changed files with 65 additions and 35 deletions (loading 1).

x
0 of 4 viewed, 4 left
5 additions and 0 deletions.changeset/scroll-state-phase.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/virtual-core': patch
+---
+​
+refactor(virtual-core): track an in-flight scroll command's lifecycle as one phase instead of several flags (no behaviour change)
1 addition and 3 deletionspackages/react-virtual/e2e/app/ios-deferral/main.tsxModified
View file
@@ -54,9 +54,7 @@
entry.def = v._iosDeferredAdjustment
entry.adj = v.scrollAdjustments
const s = v.scrollState
- entry.st = s
- ? [s.index, s.lastTargetOffset, s.hasReachedTarget, s.stableFrames]
- : null
+ entry.st = s ? [s.index, s.lastTargetOffset, s.phase, s.stableFrames] : null
if (t.watch.length > 0 && el) {
const m = v.getMeasurements()
entry.rows = t.watch.map((i: number) => m[i].start - el.scrollTop)
59 additions and 32 deletionspackages/virtual-core/src/index.tsModified
View file