TanStack / TanStack/virtual

Vue - adding bigint to Key broke :key bindings

Open
#819 0 comments 12 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.1k
Forks
466
Avg merge
2d 31m
Merged PRs (30d)
13

Description

Describe the bug

The recent change to VirtualItem.Key breaks the :key bindings in v-for loops.

Example:

Image

Your minimal, reproducible example

https://github.com/tanstack/virtual/tree/main/examples/

Steps to reproduce

Setup a virtualizer that uses a key that's not the index e.g.

const rowVirtualizer = useVirtualizer(
  computed(() => {
    return {
      count: props.items.length,
      getScrollElement: () => virtualizerRef.value,
      getItemKey: (index) => props.items[index].id, // <--- id here is string 
      estimateSize: () => 64,
      overscan: 10,
      debug: false,
    };
  })
);
Expected behavior

As a user I expected the :key bindings to not break in Vue v-for loops.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

macOS, Linux

tanstack-virtual version

3.10.6

TypeScript version

5.5.4

Additional context

No response

Terms & Code of Conduct
  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Vue examples/ directory and the useVirtualizer setup shown in the report, especially getItemKey when it returns a string id. Reproduce the v-for :key failure with a non-index key, then verify that the bindings remain stable and the relevant example or regression coverage passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.