You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
It seems that checking for $location.hash inequality in autoScrollWatchAction() before calling scroll() would fix this issue, though I'm not familiar enough with $AnchorScroll to know if that would have wider implications.
I understand that, technically, the instantiation of $AnchorScroll is unrelated to ngIncude's autoscroll attribute, but it certainly seems counterintuitive that this current behavior exists.
$AnchorScrollis instantiated whenngIncludeis compiled. Instantiation sets$AnchorScroll's watcher and calls the listener, scrolling the window to the top:https://github.com/angular/angular.js/blob/master/src/ng/anchorScroll.js#L96
It seems that checking for
$location.hashinequality inautoScrollWatchAction()before callingscroll()would fix this issue, though I'm not familiar enough with$AnchorScrollto know if that would have wider implications.I understand that, technically, the instantiation of
$AnchorScrollis unrelated tongIncude'sautoscrollattribute, but it certainly seems counterintuitive that this current behavior exists.Example Plunkr:
http://plnkr.co/edit/XMuTqFmvKB7LzRyuzLSs?p=preview