Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

virtual-core: a clamp retry can overwrite a scroll command and ignores _canWriteScroll()

オープン
#1,327 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
react, typescript

調査の方向性

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
  1. A hold flush or a compensation write is clamped. The virtualizer records a retry, for example { target: 4850, maxAtWrite: 4800 }.
  2. A scroll command writes. For example, scrollToIndex writes 550.
  3. _willUpdate or resizeItem runs 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 notify does not grow the sizer synchronously. The React adapter grows it synchronously.
  • #1324 fixed this for a queued command: _writeAwaitingCommand clears 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 _clampedAdjustment when a command starts (_startScroll), or skip the retry while scrollState !== 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時間
マージ済み PR(30日)
31

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TanStack/virtual のほかの issue

TanStack/virtual の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。