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

152
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
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