I\'ve bean searching for this for a few hours now and I have no solution. I want a smooth scroll to the top of the page. I already have smooth scrolling to separate anchors
window.scroll({top: 0, behavior: "smooth"})
Just use this piece of code and it will work perfectly, You can wrap it into a method or event.