Skip to content
Source
Sign inSign up
TanStack/virtual

Scrolling up in Lit example stutters and resets scroll #981

Openblake-logik(GitHub profile, opens in a new tab) opened this issue 1 comment

Describe the bug

I was having problems with my Lit virtualizer stuttering when scrolling back up through a dynamic list and couldn't understand why the example worked, but mine did not. So I updated the height of the items in the example, and it started to break like mine. It seems the example only works well because each item takes up most of the scroll element.

Your minimal, reproducible example

https://tanstack.com/virtual/latest/docs/framework/lit/examples/dynamic?panel=sandbox

Steps to reproduce

  1. Open the Lit dynamic example: https://tanstack.com/virtual/latest/docs/framework/lit/examples/dynamic?panel=sandbox
  2. Change the lorem ipsum generator to make shorter sentences ex. faker.lorem.sentence(randomNumber(1, 20))
  3. Scroll down a ways and then scroll back up. It will start stuttering and reseting scroll. This gets worse the larger the difference in height between items.

Expected behavior

There should not be any stutter.

How often does this bug happen?

Often

Screenshots or Videos

No response

Platform

  • OS: Mac
  • Browser: Chrome

tanstack-virtual version

v3

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.
  1. ghostcommented

    A similar problem was encountered in the Vue package, maybe you can find workaround in another issues

Sign in to join this conversation.