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

165
Visualizações
Arrow Keys - Prevent Default on Select Element

so I have a little bit of a very specific problem and I was hoping that there's a simple answer that I just haven't yet found.

Basically, I have a select element, and, while selecting an option in the select element I would like to be able to hold down the arrow up and down keys without changing the option, if that makes sense. Essentially, I need to get rid of the native key bindings for the select element so that, while pressing the up or down keys, it does not change the option I want to select. I have tried the following:

select_element.onkeyup = evt => evt.preventDefault();
select_element.onkeydown = evt => evt.preventDefault();

But it does not seem to work. I suppose a last-ditch scenario would be to completely recreate the select element from scratch, but I would really like to avoid that if possible.

about 4 years ago · Juan Pablo Isaza
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