Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected undefined in Virtualizer.scrollToIndex #879

Open
2 tasks done
damienrobson-sage opened this issue Nov 13, 2024 · 0 comments
Open
2 tasks done

Unexpected undefined in Virtualizer.scrollToIndex #879

damienrobson-sage opened this issue Nov 13, 2024 · 0 comments

Comments

@damienrobson-sage
Copy link

Describe the bug

scrollToIndex throws an error if the list of items in a drop-down is emptied after an item has been selected. From the looks of things, the measurements are being reset to 0 when calculating the location to jump to, which results in an empty array being used to find the index.

Your minimal, reproducible example

https://carbon.sage.com/?path=/story/select--with-infinite-scroll

Steps to reproduce

  1. In the example, click the dropdown;
  2. Wait for the options to load;
  3. Scroll to the bottom to trigger further option loading;
  4. Select one of the lazy-loaded options;
  5. Press the reset button and observe the console;

Expected behavior

I would expect no error to appear in the console.

How often does this bug happen?

Every time

Screenshots or Videos

Screen.Recording.2024-11-13.at.10.28.52.mov

Platform

Firefox 132.0.1 on macOS 14.6.1 (Sonoma), but happens consistently regardless of hardware/software

tanstack-virtual version

v3.10.1

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant