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

213
Vistas
How to not try to trigger disabled buttons on pressing enter by default

I have a react app, and when I was pressing enter it was triggering a hidden button, rather than the button that was showed. So I set it to disabled if hidden.

But the problem now is that "on enter" nothing happens when that button is disabled. I imagine the default behaviour is to still try to trigger the closest button on the page (regardless of if it's disabled or not).

Is there a way to alter this behaviour, or a different attribute (other than / side by side) the disabled attribute.

I know this can be done instead:

How to trigger a button click on Enter in React

But I would prefer a cleaner way to monitoring which button should be triggered on enter at a specific time

about 4 years ago · Santiago Trujillo
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