question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When can we change scroll position manually?

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
petyosicommented, Apr 18, 2020

Agreed, this part of the code is quite complex. I will try to get to that soon.

1reaction
lesha1201commented, Apr 13, 2020

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 scrollTo or sets scroll position manually on a scroll element?

UPD: Already found it

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found