Skip to content

Didn't update when option.count changes. #1066

@bowencool

Description

@bowencool

Describe the bug

When

Your minimal, reproducible example

https://github.com/TanStack/virtual/issues

Steps to reproduce

  1. Initialized with 1,000 items, the last index is 999.

  2. Insert a few items, for example, 3.

  3. You will notice that the last index remains 999, not 1,002, indicating that the last 3 items(Name 997, Name 998, Name 999) were actually lost.

CleanShot.2025-10-17.19.46.24.mp4

Expected behavior

Automatically refresh the total count when option.count is updated.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

MacOS, Firefox

tanstack-virtual version

^3.8.7

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions