Home  >  Q&A  >  body text

How to stop reacting when scrolling to bottom on button click

I have a button that when I click it should go to another page and it works, but once it navigates to another page it displays the page from the bottom even though it should display the page's beginning. How can I fix it? How can I solve this problem?

P粉302160436P粉302160436375 days ago444

reply all(1)I'll reply

  • P粉564192131

    P粉5641921312023-09-13 19:38:35

    On click in your handleseemore you can add window.scrollTo(0, 0); this will scroll to the top

    reply
    0
  • Cancelreply