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.
@shaungrady as you described the problem is that $anchorScroll does scrolling when it initializes, which usually is not a problem unless you are initializing it while the application is already running and scroll position is different than 0,0.
$AnchorScroll
is instantiated whenngInclude
is 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.hash
inequality inautoScrollWatchAction()
before callingscroll()
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 tongIncude
'sautoscroll
attribute, but it certainly seems counterintuitive that this current behavior exists.Example Plunkr:
http://plnkr.co/edit/XMuTqFmvKB7LzRyuzLSs?p=preview
The text was updated successfully, but these errors were encountered: