TanStack / TanStack/virtual

Scrolling up on mobile/trackpad resets position using Dynamic and Vue

Open
#622 4 comments 23 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

Edit

As described here, this is a working true fix https://github.com/TanStack/virtual/issues/619#issuecomment-1969516091

Describe the bug

This problem occurs when you use smooth scrolling, i.e. via touch screen or trackpad

Using the 'dynamic' version of the scroller and Vue problems occur when you scroll up. Other versions, such as fixed an variable height work fine.

Scrolling down works fine, however, the second you start scrolling up it causes a jittery movement and the rows don't actually scroll up, instead it resets its position. You can hopefully see it clearly in my provided videos. For example: row 53 stays in view.

The problem is most notable by scrolling slowly. By scrolling really fast you can get over it temporarily, but as soon as the scroll starts slowing down, the problem occurs.

This issue occurs in the offical example!

Your minimal, reproducible example

https://ryhp23-3001.csb.app/

Steps to reproduce
  1. Open on mobile or switch the mobile emulation mode using the devtools
  2. swipe down in the list, this works fine
  3. Swipe up, position keeps resetting
Expected behavior

I expect to be able to smoothly scroll up using the dynamic variant on all platforms.

How often does this bug happen?

Every time

Screenshots or Videos

https://github.com/TanStack/virtual/assets/22410563/75e62c13-91d8-4987-9242-73b217739108

tanstack scroller bug.webm

Platform

Problem occurs on:
Chromium on MacOS
Firefox on MacOS
Chrome on Android
Firefox on Android
Firefox on Windows
Edge on Windows

Problem does NOT occur on:
Webkit based browsers basically:
safari on iPhone (emulator)
safari/Chromium/Firefox iPad
Safari on MacOS

tanstack-virtual version

3.0.0-beta.68

TypeScript version

4.8.4

Additional context

The bug does not exist on the React wrapper of virtual.

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 referenced TanStack/virtual#619 comment, then reproduce the issue in the official example or the provided Vue minimal example using the dynamic scroller. Compare upward touch or trackpad scrolling with the fixed and variable-height variants and the React wrapper. Done means scrolling upward remains smooth without jitter or resetting the visible rows across the reported browsers.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.