Expose an API to cancel active scroll reconciliation
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 62/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- frontend
调研方向
从 @tanstack/virtual-core 中 reconcileScroll 附近的实现,以及 scrollToIndex 和 scrollToOffset 使用的 scrollState 开始。跟踪活动 reconciliation 目标及其安全限制的管理方式,然后检查现有的 core 测试(如果有)。当公共 cancelScrollTo API 能够停止活动目标、而不改变当前 DOM offset,并保留后续测量补偿时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Describe the use case
A virtualizer may have a long-distance scrollToIndex reconciliation in progress while the user begins a genuine wheel, touch, pointer, or keyboard scroll. The application must immediately hand viewport ownership back to the user.
In @tanstack/virtual-core 3.17.8, reconcileScroll can continue correcting toward the old target for up to the five-second safety limit. There is no public way to cancel it. The only effective application workaround is a private-field write:
;(virtualizer as unknown as { scrollState: unknown }).scrollState = null
That works, but is intentionally outside the public contract and can silently break on upgrade.
Requested API
A public method such as:
virtualizer.cancelScrollTo()
It should cancel the active scrollToIndex / scrollToOffset reconciliation target without changing the current DOM offset. This lets a user gesture take ownership immediately while preserving normal subsequent measurement compensation.
Why this belongs in core
- Core owns the reconciliation state and its lifecycle.
- Consumers cannot reliably infer or cancel every pending internal frame/timer.
- User input cancellation is needed by chat timelines and other dynamic, long-distance virtual navigation surfaces.
Version
@tanstack/virtual-core 3.17.8; the same private-only state is present on current main.
- 主要语言
- TypeScript
- 星标
- 7.1k
- 派生
- 466
- 平均合并
- 2 天 31 分钟
- 30 天内合并 PR
- 13
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TanStack/virtual 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 55/100
-
难度 5/5 一周以上 新手友好度 38/100
-
难度 4/5 3-5 天 新手友好度 55/100
-
难度 3/5 1-2 天 新手友好度 68/100
-
难度 4/5 3-5 天 新手友好度 42/100
相似的 Issue
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 1/5 1 小时以内 新手友好度 85/100
-
Mend: dependency security vulnerability untriaged
难度 2/5 1-3 小时 新手友好度 70/100