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

129
Vistas
Add input and keyboard navigation in a custom Dropdown

I have created this custom Dropdown from scratch, it's inspired a bit by React Select and very similar to what I have to create at work. I'm happy with it, but I have a few blocking issues.

First of all, I'm trying to make the Dropdown "searchable". Basically the user can type something, to narrow down the list of options that can be selected. For this, I have implemented an <input type="text /> that receives focus when the menu is open. It's somewhat fine I guess, but the input must be wrapping around the width of the content it has, so currently it looks off. I guess this can be done with CSS.

Now, the next problem is related to the first point above. I'm trying to implement a keyboard navigation, basically move between the options with arrow up/down and be able to select an option with Enter. Since the input receives focus in this case, I don't know how to implement this keyboard navigation since it would conflict.

If I don't focus the input, then we can't type. So I am not sure what to do in this case.

Here's the Dropdown.

Here's an example of what I want to achieve. https://jquense.github.io/react-widgets/docs/Multiselect#overview

As you can see here, when opening the menu, the input is still focused, but we can also navigate with arrows through the menu options.

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