Below Playground I have code with the button to scroll at the top of the page and conditionally render the button when user scrolled down. Now if I remove the custom render thing then button works as expected but when I add the custom css for conditional rendering then button stopped working,
On above playground when you scroll down, a button will appear at the bottom left but when you click on it won't scroll at the top.
Best Answer
You can even use
window.scrollTo
option, if you want to scroll till top.HTML (add this at end):
CSS: