Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

161
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!