How to reset a page after leaving the view


#1

Hi , i have a component where it lists items and can lead to other pages by clicking on the items
I want to reset the list to start from top (OR pop the page and reset the list) whenever the user leaves the component (e.g when changing to different menu item)

i know that i have to use one the lifecycle hooks , maybe ionViewDidLeave() and reset there… but i dont know what commands should write for that ?


#2

soo you want to scroll to the top when the user navigates away from the page?

While this is possible, it may be bad for user experience, as they should expect the app to maintain the scroll position.