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

153
Visualizações
React From Group input field is not working

I attached dropdown items to my form group input field (image below). When I add onChange() key in order to get its value, I cannot write anything to input field. But when I remove onChange() key, it is working, I am able to write anything, but I need to get the value of input field. Is there any other way than onChange() key or any solution? Thank you in advance :) Here is the my code:

<Form.Control
        ref={ref}
        onClick={e => {
          e.preventDefault();
          onClick(e);
        }}
        size="sm"
        type="text"
        className="search-or-jump shadow-none"
        placeholder="Search or jump to..."
        onChange={event => setSearchName(event.target.value)}
      />
      {children}
    </Form.Group>

enter image description here

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

0

You have to add value attributes, like

<Form.Control
    ref={ref}
    onClick={e => {
        e.preventDefault();
        onClick(e);
    }}
    size="sm"
    type="text"
    className="search-or-jump shadow-none"
    placeholder="Search or jump to..."
    value={searchName}
    onChange={event => setSearchName(event.target.value)}
/>
   {children}
</Form.Group>

Your code didn't have value attribule but you called 'value' on 'onChange' that why your code didn't work.

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