Ion-scroll: Scroll programmatically


#1

Apparently, ion-scroll has no API unlike ion-content. The latter can be scrolled with scrollTo(), but how do you programmatically scroll an ion-scroll? Also, ion-scroll has no .nativeElement if fetched via @ViewChild('scrollContainer') scrollContainer: ElementRef. So I don’t even see a way to call a non-Ionic API.

Any ideas how to scroll ion-scroll programmatically?

Background: I have a big Canvas in an ion-scroll and I need to automatically scroll to the right side of that Canvas.


#2

If you read the $ionicScrollDelegate docs you will see that it is also used for scrolling views created by ion-scroll.

http://ionicframework.com/docs/v1/1.2.1/api/service/$ionicScrollDelegate/


#3

Thanks for the quick reply, but I’m talking about Ionic 2 :wink: