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

150
Views
Resetting the keyboard tab position on a React SPA (Single page application)

I have a Single Page Application built using React. As usual, when changing between pages, the rendered components changes.

Problem

If I navigate to a button using Keyboard and press enter, it switches the component as expected. However, I want the page to reset the keyboard position to the start of the page. I tried a few solutions, but no luck.

Solutions I've tried:

document.activeElement.blur()

or

document.body.focus()

I've spun up a codesandbox example to illustrate the situation.

Link for the sandbox: https://codesandbox.io/embed/affectionate-snow-ctxi9

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!