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

168
Visualizações
AutoComplete only selects value if I click on the dropdown suggestion
        <Autocomplete
          disablePortal
          id="geo-select-country"
          options={all_country}
          defaultValue={nation}
          onChange={(event, selected_nation) => {
            set_nation(selected_nation);
          }}
          classes={autocomplete_classes}
          renderInput={(params) => (
            <TextField {...params} label={"Country"} margin="none" focused />
          )}
        />

For example, if I type out "United States" and then click enter or click away, nothing will be selected. I would have to click on the dropdown suggestion for "United States" in order for it to be selected.

Why do I fix this?

EDITED:

Here is a live example:

https://codesandbox.io/s/wizardly-frost-9cj0v?file=/src/App.js

Values can only be selected if you actually click them in the dropdown. Even if you type the value exactly as it is suggested and then click enter, it will not be selected.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

To solve selecting value by pressing Enter, you can use autoHighlight={true} prop and also in order to solve the clicking outside issue, you can use autoSelect={true} with Autocomplete.

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