Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

156
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda