Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

214
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda