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

scrollToIndex center - incorrect align #559

Open
2 tasks done
PurpleTape opened this issue Jun 17, 2023 · 2 comments · May be fixed by #864
Open
2 tasks done

scrollToIndex center - incorrect align #559

PurpleTape opened this issue Jun 17, 2023 · 2 comments · May be fixed by #864

Comments

@PurpleTape
Copy link

Describe the bug

When a scrollToIndex call is made, a scroll to the index block occurs.

If scrollToIndex align value has start, then the scroll will be scrolled so that the upper part of the index block coincides with the upper border of the parent block

If scrollToIndex align value has end, then the scroll will be scrolled so that the lower part of the index block coincides with the lower border of the parent block

If scrollToIndex align value has center, then the scroll will be scrolled so that the upper part of the index block coincides with the central line of the parent block, but there is no alignment along the central line of the index block

Your minimal, reproducible example

https://codesandbox.io/p/sandbox/wonderful-swanson-vczltl?embed=1&file=%2Fsrc%2Fmain.tsx%3A35%2C23-35%2C36

Steps to reproduce

  1. Go to reproduce link
  2. Open browser console (Here you can see the random index to which the scroll is made)
  3. Press "scroll to the middle"

Expected behavior

scrollToIndex with the value center is called so that the block with the specified index is aligned along the center line of the parent and relative to itself

How often does this bug happen?

None

Screenshots or Videos

No response

Platform

macOS
Firefox 114.0.1

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.
@strictlylucian
Copy link

tested this out in a project I'm working on, still a problem

@christriants
Copy link

Hi. I would like to make an attempt at fixing this one, assuming the current behavior is not intended.

@christriants christriants linked a pull request Oct 27, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants