Open stueja opened 8 years ago
Hello... I'm experiencing the same issue and trying to figure out a solution. I'm bummed no one's responded to you on this. I'm still plugging away at it. If I come up with a solution, I'll post it here.
That's expected behavior when you preventDefault()
on anchor links.
Use history.pushState()
to update url.
I found out that scrolling to an anchor works wonderfully, however breaking the browser's back button's functionality (Chromium, Firefox, Safari Mobile). After commenting out the below, the back button works, however not scrolling smoothly.
I was trying onpopstate and different onpushstate variants to have it scroll smoothly to the top again, upon clicking the back button, but wasn't able to do so. If you have an idea, I'd appreciate it.