Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sliding view with angular ui-router and ng-animate auto scroll to targeted view

I'm using AngularJS's ui-router and ngAnimate to create the classic sliding view in mobile.

I found that at the beginning of the transition when both view exist on the page, if the targeted view is out of the view port, it will jump to that view position first, which give us the funny effect like this:

plunker

Is there anyway to avoid this?

like image 285
jackysee Avatar asked Jan 12 '23 09:01

jackysee


1 Answers

Angular UI-Router recently updated it's app so that it automatically scrolls down to new views loaded by default. This was causing my app's pages to load scrolled down. To turn this off simply add the following attribute to your ui-view:

<div ui-view="header"  autoscroll="false"></div>
like image 147
kartikluke Avatar answered Apr 26 '23 22:04

kartikluke