I am trying to implement custom logic to return the visitor to their previous scroll location when hitting the back button. There are many posts out there about storing it in localStorage/sessionStorage, but the issue is that it would always return to that location even if you returned to the page through a different path then hitting the back button.
Is it possible in SmoothState's onAfter callback to detect how the user got to the page and if they used the back button?
I am trying to implement custom logic to return the visitor to their previous scroll location when hitting the back button. There are many posts out there about storing it in localStorage/sessionStorage, but the issue is that it would always return to that location even if you returned to the page through a different path then hitting the back button.
Is it possible in SmoothState's onAfter callback to detect how the user got to the page and if they used the back button?