-
Notifications
You must be signed in to change notification settings - Fork 16
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
Scrolling to item #21
Comments
Hi. If the item hasn’t been rendered yet then its top position is unknown.
In those cases, precise scroll-to is impossible.
…On Thu, 7 Mar 2024 at 12:10, Sami Ibrahim ***@***.***> wrote:
Hey, thanks for the amazing work here ❤️
I'm utilizing virtual-scroller to display a vast list of items (10,000+).
I'm aiming to scroll the user to a particular item based on its index
(e.g., navigating to index 5931). Currently, I determine the scroll
position by:
Obtaining the estimatedItemsHeight.
Multiplying it by the itemIndex.
However, this method lacks precision because the estimatedItemsHeight can
easily deviate. Is there a more accurate approach to determine the scroll
position?
—
Reply to this email directly, view it on GitHub
<#21>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADUP32XB27SABZVHXAWUU3YXAVIJAVCNFSM6AAAAABEKS55O6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGE3TGMZVGUYTIMA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Umm, wouldn't it be possible if the following happen:
Not sure if this is practical though. Also one random question, would it be possible to fire an event or call a callback when the initial render is done? |
I don't think that it would be practical because the scrolling wouldn't be smooth: it would scroll almost to the end, wait for it to render, then scroll almost to the end, wait for it to render, etc, until item N is rendered.
There's a |
Love this functionality as well! I agree that it would be fantastic to be able to programmatically scroll to a given element index |
Hey, thanks for the amazing work here ❤️
I'm utilizing virtual-scroller to display a vast list of items (10,000+). I'm aiming to scroll the user to a particular item based on its index (e.g., navigating to index 5931). Currently, I determine the scroll position by:
getAverageItemHeight
.itemIndex
.However, this method lacks precision because the
getAverageItemHeight
can easily deviate. Is there a more accurate approach to determine the scroll position?The text was updated successfully, but these errors were encountered: