Expose an API to cancel active scroll reconciliation
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 62/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- frontend
Research direction
Start in the @tanstack/virtual-core implementation around reconcileScroll and the scrollState used by scrollToIndex and scrollToOffset. Trace how the active reconciliation target and its safety limit are managed, then inspect the existing core tests if available. Done means a public cancelScrollTo API stops the active target without changing the current DOM offset and preserves later measurement compensation.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- TypeScript
- Stars
- 7.1k
- Forks
- 468
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 12
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from TanStack/virtual
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 38/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
TanStack/virtual#1257 · 1 reaction ·
Maintainers usually reply within 1 day
All issues in TanStack/virtual
Similar issues
-
triage
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
mermaid-js/mermaid-live-editor#2053 ·
Maintainers usually reply within 1 day
-
factory
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
jessepollak/home#1455 ·
Maintainers usually reply within 1 day
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
lingdojo/kana-dojo#31227 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
appandflow/stim#1838 ·
Maintainers usually reply within 1 day