When can we change scroll position manually?
See original GitHub issueI need to restore scroll position manually by setting scrollTop to scroll container element. But everything I tried has effect of seeing first element and then jumps to certain position. Also it looks like there is code that runs asynchronously in Virtuoso so sometimes scroll doesn’t restore and I don’t know when I should modify scrollTop
Example of what I’m trying to do: https://stackblitz.com/edit/react-kn82nn-ohhw1t
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
How to Change the Position of Scrollbar using CSS
We can use the CSS “::-webkit-scrollbar” property which is responsible for changing the shape, color, size, shade, shadow, etc. of the scroll ...
Read more >Set scroll position - javascript - Stack Overflow
If you want to set the scroll position of document.body , you can scroll the entire window altogether using window.scrollTo() ; it takes...
Read more >Element.scrollLeft - Web APIs | MDN
The Element.scrollLeft property gets or sets the number of pixels that an element's content is scrolled from its left edge.
Read more >How to set the scrolling position of a scroll bar? - Unity Forum
I'm on Unity 5.2.3p3 and I want to reset the scrollrect/scrollbar ... So if you move the scroll rect content to the position...
Read more >Manual: Scroll Rect - Unity
A UnityEvent that is invoked when the scroll position of the Scroll Rect changes. The event can send the current scroll position as...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Agreed, this part of the code is quite complex. I will try to get to that soon.
I’ll look into code and think about API. After that I’ll write my ideas if I have free time. But this is probably going to be on weekends. Thanks anyway
Can you please point me to the code where initial index logic calls
scrollToor sets scroll position manually on a scroll element?UPD: Already found it