Skip to content

Expanding an item that is partially obscured by the top of the scrolling window causes the item to move upwards #562

Open
@adlai-arnold

Description

@adlai-arnold

Describe the bug

Expanding an item should never move the top of the item--it should always expand downwards. However, if the scroll window occludes the top of the item, it will instead move upwards when expanded.

This issue does not occur in 3.0.0-beta.35 and earlier.

Your minimal, reproducible example

https://codesandbox.io/p/sandbox/zen-blackburn-tnrzfr

Steps to reproduce

  1. Scroll down such that an item is partially occluded by the top of the scroll window
  2. Click on the occluded item to expand it
  3. Note that the top of the item jumps up and out of view
  4. Change the @tanstack/react-virtual version number to 3.0.0-beta.35 and run npm i && npm run dev, then redo steps 1-3 and see that the item does not move

Expected behavior

As a user, I expect that expanding an item will not cause it to move.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

MacOS 13.4.1 (22F82), Chrome Version 114.0.5735.198 (Official Build) (arm64)

tanstack-virtual version

3.0.0-beta.54

TypeScript version

No response

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