Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Expose an API to cancel active scroll reconciliation

未关闭
#1,285 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

TanStack/virtual 的其他 Issue

查看 TanStack/virtual 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。