I'm facing an issue with scrolling on my angularjs app.
Currently, the app consists of 2 pages: The first page displays a list of customers, where you can select one to view their details. The second page is a list of companies, following a similar selection process.
To navigate between these pages, I am using a panel along with $location.path()
. Additionally, there is a back button implemented using $window.history.back()
.
The problem arises when selecting an item from either the customers or companies list and then pressing the back button - the app returns to the previous page while maintaining the scroll position. This behavior occurs without any custom implementations, solely relying on $window.history.back()
.
However, the issue happens when transitioning to another page (without scrolling) after using the back button - the scroll position remains unchanged. Yet, simply scrolling even slightly will reset the position. Furthermore, if the back button isn't used, everything functions as expected.
Therefore, the main concern is determining how to reset the scroll position when moving to another page post the use of $window.history.back()
.
It's worth noting that I have incorporated the infinite-scroll
plugin, although disabling it did not impact the situation, leading me to believe the plugin itself is not the cause of the problem.