Skip to content
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

Docs for autoscroll #720

Closed
timkindberg opened this issue Dec 28, 2013 · 8 comments
Closed

Docs for autoscroll #720

timkindberg opened this issue Dec 28, 2013 · 8 comments
Assignees
Labels
Milestone

Comments

@timkindberg
Copy link
Contributor

See #715

@ghost ghost assigned timkindberg Dec 28, 2013
@kbanman
Copy link

kbanman commented Jan 23, 2014

Yeah, I'm confused as to why autoscroll is on by default. I can't think of a use case where I'd like it on.
To save others looking through the source for usage instructions, and in lieu of documentation, here's how to turn it off:

<div ui-view autoscroll="false"></div>

The autoscroll attribute is an expression, so you could link it to a scope variable to dynamically change the behaviour for that view.

@nateabele
Copy link
Contributor

It's on by default to maintain BC. We were considering resetting it though.

@randallmeeker
Copy link

What backwards compatibility? I'm a little confused on this one as well. In angular the autoscroll ng-view is disabled by default. In ui-router it was never enabled before, so for me, this makes it not bc cause i'm going through and updating all of my code to autoscroll=false. I have already done this, so no real issue for me. Was also just curious, . .. ui-router rocks!!

@nateabele
Copy link
Contributor

Pretty sure that's not accurate. In previous versions, $anchorScroll() was called by default.

@randallmeeker
Copy link

I think there is confusion, at least I was confused, as to what $anchorscroll did/does and how 2.8 is different.

$anchorScroll() was called by default previously, but that just scrolls based on the hash. So those of us that did not have any anchors in our app did not even notice $anchorscroll. However, in 2.8 the view is automatically scrolled into view and $anchorScroll() is NOT called by default. So by specifying autoscroll=false, we are actually turning $anshorScroll back ON and stopping ui-router from just scrolling to the current view. Using "false" does not actually do anything, you could have autoscroll="bob" and you would get the same effect.

Am I wrong?

@timkindberg
Copy link
Contributor Author

@randallmeeker $anchorScroll is for anchors, autoscroll/$uiViewScroll is for views, makes sense. So I agree that having it default to OFF is the correct behavior. Of course, you'll still have to do $uiViewScrollProvider.useAnchorScroll() for full backward-comp.

@timkindberg
Copy link
Contributor Author

I'll open a new issue for setting the default behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants