I just spent over an hour on this and I am still confused.
I am 99% sure at this point it’s a bug in Chrome, although I can’t find anyone else on the web reporting it. It seems that:
- If you visit a topic page
- Hit the back button
- Go forward into a topic (needn’t be the same)
- Adjust the innerHTML of any element on the page
Then the page will scroll randomly (usually upwards).
innerHTML change, so it’s not jQuery. In fact, I can cause it outside of an event loop such as ember by just running a command like
document.getElementById('post_25').innerHTML = 'hello'
I’m not sure how to proceed here – perhaps it will just be fixed shortly in Chrome? To make a bug report for them would involve tearing away many parts of Discourse until we could isolate it.