Skip to content

fix(virtual-core): add 'instant' to ScrollBehavior type#1122

Open
muraliavarma wants to merge 2 commits intoTanStack:mainfrom
muraliavarma:fix/scroll-behavior-instant-type
Open

fix(virtual-core): add 'instant' to ScrollBehavior type#1122
muraliavarma wants to merge 2 commits intoTanStack:mainfrom
muraliavarma:fix/scroll-behavior-instant-type

Conversation

@muraliavarma
Copy link

🎯 Changes

Add 'instant' to the ScrollBehavior type in virtual-core.

The W3C spec defines ScrollBehavior as "auto" | "smooth" | "instant", and all modern browsers support it. The library's custom type only included "auto" | "smooth", causing a TypeScript error when using behavior: 'instant' with scrollToIndex / scrollToOffset.

Closes #1074

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

The W3C spec and all modern browsers support 'instant' as a valid
ScrollBehavior value, but the type only allowed 'auto' | 'smooth'.

Closes TanStack#1074
@changeset-bot
Copy link

changeset-bot bot commented Feb 10, 2026

🦋 Changeset detected

Latest commit: 2d66e31

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@tanstack/virtual-core Patch
@tanstack/angular-virtual Patch
@tanstack/lit-virtual Patch
@tanstack/react-virtual Patch
@tanstack/solid-virtual Patch
@tanstack/svelte-virtual Patch
@tanstack/vue-virtual Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeScript types for scrollToIndex behavior missing 'instant' option

1 participant