JedWatson / JedWatson/react-select
using Select inside <form /> with onChange
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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