Ionic: cannot scroll when using anchorScroll in ionic

We use scrollTo functions in the ionic application by setting $location.hash(id) and $anchorScroll() . Scrolling down works fine, but we cannot scroll a page after scrolling to a certain location using $anchorScroll and $location.hash() .

See the problem in codepen . Press the "Down" button and try to go back.

Please provide a solution to fix this scrolling issue.

+3
source share
1 answer

In the section "ion-content" div add overflow-scroll = "true"

 <ion-content overflow-scroll="true"> 

then in your controller:

 $scope.scrollTo = function(id) { $location.hash(id); $ionicScrollDelegate.anchorScroll(); }; 

Further information on this issue in the Ionic Framework can be found here: http://forum.ionicframework.com/t/content-stuck-after-anchorscroll/776

+5
source

All Articles