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

271
Visualizações
How to render options as a dropdown for the input?

I am currently working on a react component that filters some data and the component's primary use is that as a user types, it filters the data and outputs the data for the user to choose from. The data output is also clickable. Right now, my options are being listed like this:

picture 1

However, I would like this to be presented in a more dropdown fashion, instead of just listing them. For instance, like googles search results page:

picture 2

Here is my part of code that renders the options. The label part is what is presenting my options, but a more dropdown fashion would be nice that would be underneath or attached to the search bar. any advice would be helpful. Thanks a ton!

 return (
    <Fragment>
    <input type="text" placeholder="Enter Brewery Name" style={{ width: "40%", marginTop: "10px"}}
    className="search-box" onChange ={(debounce((e) => searchBreweries(e.target.value)))} />
        {searchBrews && searchBrews.map((brew) => {
        return (
            <ul>
                <label class="search" name="state" onClick={() => history.push({
                    pathname: '/BrewDetails', 
                    currentbrew: brew})}>
                        <option value="AL">{brew.name}</option>
                    </label>
                    
            </ul>
        )
    })
}
    </Fragment>

);

}

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