1

I am facing an issue in my MVC project that when I run it in Chrome, Chrome keeps auto scrolling it to top. I need to disable it or handle it to ot scroll. The chrome version I am using is 70.0.3538.110.

Here is the piece of code I am using to forcefully scroll to bottom:

domElement.scrollTop = domElement.scrollHeight;

2 Answers2

2

Do you have any web worker running which tampers scrolling? If yes then try disabling them.

Thanks

Jayoti Parkash
  • 868
  • 11
  • 26
1

You need to scroll to the bottom of the dom element, not just to the top of it.

domElement.scrollTop = domElement.scrollHeight + domElement.offsetTop;
Ahmad
  • 12,336
  • 6
  • 48
  • 88
  • Alrite. While I try it out. Could you give a little bit detail as to why that needs to be done, and what specific in chrome is making it do that, as I am not facing this issue in any other browser. – Gurpreet Singh Drish Nov 29 '18 at 09:33
  • You will find more information [here](https://stackoverflow.com/questions/635706/how-to-scroll-to-an-element-inside-a-div) – Ahmad Nov 29 '18 at 09:36