-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default view scroll to off when autoscroll
attr not specified
#807
Comments
Ideally, I think that developers should be able to specify the "default" behavior in the As long as that's provided, I don't think that it matters which behavior ui-router uses out of the box... As long as we can easily override it. |
I agree, I'd like it to be a |
So maybe eliminate the //scrolls to nothing when no autoscroll attrs are present
$uiViewScrollProvider.defaultScroll = 'none';
//scrolls to last populated view when no autoscroll attrs are present
$uiViewScrollProvider.defaultScroll = 'view';
//scrolls to anchor from url when no autoscroll attrs are present
//this would revert back to regular $anchorScroll behavior
$uiViewScrollProvider.defaultScroll = 'anchor'; |
-1 for magical hardcoded values. The way it is now follows Angular core conventions and is extensible through existing interfaces. |
But we should probably still turn the scroll bit off by default. I think more people would rather it be off. |
I think it should be off by default, or at least have the option to turn it off for all views in the config phase. Right now I'm stuck with updating all my views with autoscroll="false" |
+1 for off by default. |
That's fine with me. |
+1 For turning it off. I just lost a few hours to figuring out why my pages were loading scrolled down. It was starting to kill my self-esteem as a programmer! Otherwise, I love ui-router, thanks for making it :) |
+1 For turning it off |
@ac360 I had the exact same problem. Something like this should either be off by default or in the first page of the quick-start guide to not confuse people. At the very least there should be an easy way to turn it off globally. In the meantime I "fixed" it with this code in my module.config: $uiViewScrollProvider.useAnchorScroll(); |
@martijnve Agreed. You can also turn off the autoscroll by adding the autoscroll="false" attribute to your ui-view tags: < div ui-view="header" autoscroll="false"> |
Breaking Change: If you had ui-views that you wanted to autoscroll to on state change, you may now need to explicitly add `autoscroll="true"`. Fixes #807
+1 for off by default. Official ngRoute's However, if Besides, as much as I try, I still don't get what
Result: no scroll at all.
Result: autoscrolls to the
Result: scrolls to anchor (scrolls to page-top if no anchor). If |
Breaking Change: If you had ui-views that you wanted to autoscroll to on state change, you may now need to explicitly add `autoscroll="true"`. Fixes #807
Breaking Change: If you had ui-views that you wanted to autoscroll to on state change, you may now need to explicitly add `autoscroll="true"`. Fixes #807
+1 for off by default. |
See discussion in #720
If the
autoscroll
attr is not specified then no scrolling should occur.The text was updated successfully, but these errors were encountered: