Scroll to top of grid

  angular, ionic-framework

I have been researching this but nothing seems to work. I am using Ionic 5 and angular 8. I have a div, and in there is an ion-grid which shows my query results. At the bottom I have paging. My issue is that when you click to go to another page of results, angular sends a server side request for the next page and it successfully loads, but the page remains at the bottom of the page where the paging is. I want it to go back to the top of the list when the new page is loaded.
Further complicating this (I assume) is my toolbar and a "sticky" header row (ion-row) which I am thinking makes the page think that it is already scrolled to the top. I have tried scrollTo on both the window and the div in my angular code but it has no effect.

Please help

Source: Angular Questions

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.