Pervasive AngularJS drops scroll position on browser back #7881
Description
When using AngularJS for everything on a page that could easily be done in a static way (see angularjs.org), using the back button becomes irritating because the scroll position is alway reset.
To reproduce:
- go to https://docs.angularjs.org/api/ng/type/$rootScope.Scope
- scroll down to
$watch
- click
strict comparison
(in the second list item) - go back (browser back button)
At that point, you should see the text for $watch
but you will see the page title instead. In Firefox and Internet Explorer, this even happens for in-page links (click $digest()
)!
TIcket #727 says that the reset is a feature. For cases like this, however, it's highly detrimental because it loses default browser behavior in a bad way. I think this also falls under "don't break the back button".
Apart from actually having AngularJS remember the scroll position, I think it would be good if AngularJS weren't applied as a matter of course on angularjs.org, but only as needed – and since the documentation pages don't really need to be built by on-page javascript, a good old-fashioned server-side render might be in order.