Skip to content

fix: add 'instant' to ScrollBehavior type#1138

Closed
isaackaara wants to merge 1 commit intoTanStack:mainfrom
isaackaara:fix/scroll-behavior-instant-type
Closed

fix: add 'instant' to ScrollBehavior type#1138
isaackaara wants to merge 1 commit intoTanStack:mainfrom
isaackaara:fix/scroll-behavior-instant-type

Conversation

@isaackaara
Copy link

The ScrollBehavior type was defined as 'auto' | 'smooth', missing 'instant'.

The native browser scrollTo API supports three values: auto, smooth, and instant. Passing behavior: 'instant' to scrollToIndex works at runtime but TypeScript rejects it.

One-line change: adds 'instant' to the union type in virtual-core/src/index.ts.

Fixes #1074

The native browser scrollTo API supports three behavior values:
'auto', 'smooth', and 'instant'. The ScrollBehavior type was missing
'instant', causing a TypeScript error when passing behavior: 'instant'
to scrollToIndex even though it works fine at runtime.

Fixes TanStack#1074
@changeset-bot
Copy link

changeset-bot bot commented Mar 6, 2026

⚠️ No Changeset found

Latest commit: fb7a7dc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@piecyk
Copy link
Collaborator

piecyk commented Mar 6, 2026

Closing as duplicate of #1122

@piecyk piecyk closed this Mar 6, 2026
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

2 participants