Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

566
Views
How to prevent React Router DOM from scrolling page to top on navigate replace state?

When I am doing this:

navigate(
  `${window.location.pathname}?query=${encodeURIComponent(
    JSON.stringify(q)
  )}`,
  { replace: true }
);

If I scroll down a little from the page, then change a <Select /> input value, which triggers an update to this query in the URL, react-router-dom is scrolling the page to the top. When I remove this navigate code and change the select inputs, no jumping to the page top occurs, so it must be react-router-dom somehow. How do I disable or prevent this "jump to page top" behavior in react-router-dom?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!