Ionic V4 (angular) content.scrollToTop

Viewed 5980

In Ionic V3.X, this would scroll view to top:

@ViewChild(Content) content: Content;

this.content.scrollToTop();

In Ionic V4, this no longer works - 'Property scrollToTop does not exist on type Content'.

Is there an alternative? Thanks.

3 Answers

Seems like the scrollToTop() method was added in v4.0.0-beta.3 but some issues were fixed a few hours ago in v4.0.0-beta.6, so please update Ionic to the beta.6 version and the scrollToTop() method should be available there.

EDIT:

Thanks, but I'm already on V4.0.0-beta.6. Checking API, clearly there is no scrollToTop() anymore.

I'm sorry to insist, but I've just installed V4.0.0-beta.6 and I'm able to use the scrollToTop() method without any problems:

enter image description here

enter image description here

Related