virtual-core: a clamp retry can overwrite a scroll command and ignores _canWriteScroll()
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- react, typescript
- 领域
- frontend, performance
调研方向
Start in the virtual-core scroll write path: _retryClampedAdjustment, _canWriteScroll, _startScroll, _writeAwaitingCommand, and the _willUpdate and resizeItem calls that grow the sizer. Reproduce the case where a clamped retry at { target: 4850, maxAtWrite: 4800 } fires after a scrollToIndex write to 550. Done when a command's target is never overwritten by a retry, the retry respects _canWriteScroll(), and tests cover desktop and the iOS 27 tail timer.
由索引模型根据 Issue 内容生成。
描述
Problem
_retryClampedAdjustment repeats a compensation write that the browser clamped because the sizer was not big enough yet (#1258). It has two problems.
1. The retry can overwrite a scroll command
- A hold flush or a compensation write is clamped. The virtualizer records a retry, for example
{ target: 4850, maxAtWrite: 4800 }. - A scroll command writes. For example,
scrollToIndexwrites 550. _willUpdateorresizeItemruns before the command's read-back. The sizer is now bigger, so the retry writes 4850.
The scroll position is 4850, not the target of the command.
- This occurs on desktop and on iOS.
- On iOS 27 it occurs more often. The tail timer flushes the hold and then writes a queued command in the same task.
- It occurs only with adapters whose
notifydoes not grow the sizer synchronously. The React adapter grows it synchronously. - #1324 fixed this for a queued command:
_writeAwaitingCommandclears the retry. Other commands still have the problem.
2. The retry ignores _canWriteScroll()
The retry can write during the iOS touch tail or under a finger that drags. iOS ignores a write under a finger. On iOS 26 and earlier, a write during the tail stops the momentum.
Possible fix
- Clear
_clampedAdjustmentwhen a command starts (_startScroll), or skip the retry whilescrollState !== null. - In
_retryClampedAdjustment, return early when_canWriteScroll()is false. Keep the record for the next opportunity. - Add tests for desktop and for the iOS 27 tail timer.
Found during the review of #1324. Related: #1258, #1307.
- 主要语言
- TypeScript
- 星标
- 7.1k
- 派生
- 472
- 平均合并
- 1 天 3 小时
- 30 天内合并 PR
- 31
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TanStack/virtual 的其他 Issue
-
anchorTo: 'end' loses the end when the scroll element shrinks可能已有人在做 @langleyd 于 9 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 68/100
维护者通常 1 天内回复
-
marko-virtual: scrollToEnd during an in-flight prepend strands the view one prepend above the bottom (chat-pretext e2e fails on CI)可能已有人在做 @prayaggaikwad96 于 3 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 55/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 42/100
TanStack/virtual#1252 · 2 条评论 ·
维护者通常 1 天内回复
-
lit-virtual: VirtualizerController never applies updated options after construction可能已有人在做 @waterWang 于 65 天前认领。 未关闭
难度 5/5 一周以上 新手友好度 45/100
维护者通常 1 天内回复
-
Dynamic sizes lit demo crashes/ loads very slowly可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 4/5 3-5 天 新手友好度 45/100
TanStack/virtual#1188 · 11 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 1/5 1-3 小时 新手友好度 75/100
siyuan-note/siyuan#20629 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Volume eject does not refuse system, root or /home mounts可能已有人在做 @bernardopg 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
spacedriveapp/spacedrive#3159 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
melgarafael/DeskcommCRM#3000 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
callstackincubator/simlock#639 ·
维护者通常 1 天内回复