I am following this ionic5 and github documentation in order to programmatically scroll my page to a point. Following is the code
getContent() {
return document.querySelector('ion-content');
}
scrollPage() {
this.getContent().scrollToPoint(100,100);
}
Method scrollToPoint() is not doing anything. Is there another way of calling this method?
You can not apply methods at item obtained by selector. You must be select this ion-content with @ViewChild and can use methods:
@ViewChild(IonContent) content: IonContent;
content.scrollToPoint(100,100);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With