JedWatson / JedWatson/react-select

using Select inside <form /> with onChange

Open
#5,314 4 comments 13 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

issue/bug-unconfirmed
Dominant language
TypeScript
Stars
28k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

I use tag <form/> with onChange for observing the changes from form fields. Native <select /> tag works correctly, but changes inside Select from react-select don't trigger onChange.

<form onChange={handleChange}>
      <input />
      <select type="select">
        <option value="123">123</option>
        <option value="321">321</option>
      </select>
      <Select
        className="basic-single"
        classNamePrefix="select"
        name="color"
        options={colourOptions}
      />
</form>

Example:

https://codesandbox.io/s/react-select-v5-sandbox-forked-c1ew9k

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the behavior in the linked CodeSandbox, comparing the native select with react-select inside a form using onChange. Trace the Select event handling from the example and identify the relevant project entry point; the issue is done when changes from Select reliably reach the form's onChange handler.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.