Selecting multiple options that have the same value.
See original GitHub issueI am trying to allow the react-select component to select the same option multiple times. Currently if I select an option it is removed from the dropdown and thus cannot be selected again. How can I disable this logic and allow selecting the same option many times?
const options = [ { value: 'aapl', label: 'Apple' }, { value: 'msft', label: 'Microsoft' }, { value: 'tsla', label: 'Tesla' } ] <Select placeholder={'Select multiple stocks to chart'} isMulti={true} options={options} />
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Select Multiple Items from a Drop Down List in Excel
He wanted to make multiple selections from the same drop down in such a way that the selections get added to the already...
Read more >How to get all selected values of a multiple select box?
No jQuery: // Return an array of the selected opion values // select is an HTML select element function getSelectValues(select) { var result...
Read more >HTML select multiple Attribute - W3Schools
For Mac: Hold down the command button to select multiple options. Because of the different ways of doing this, and because you have...
Read more >Excel Data Validation Drop Down Select Multiple Items
Add Values To the Same Cell. With another variation in the VBA code, you can keep all the selected items in the same...
Read more >How to have multiple Select options with same value? - Support
Like it says on the tin I would like to have multiple select options with the same value. For instance: 100 : Item...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Set the
hideSelectedOptions={false}
prop on the<Select>
, that will prevent the option from being removed once selected. You can then handle multiple clicks of the same option. Note that the action passed toonChange
will alternate betweenselect-option
anddeselect-option
.🤔 Your use-case does sound a little odd though. Consider whether you’re sticking to common and familiar UX patterns, otherwise, you may end up with an unintuitive interface.
Hello -
In an effort to sustain the
react-select
project going forward, we’re closing old issues.We understand this might be inconvenient but in the best interest of supporting the broader community we have to direct our efforts towards the current major version.
If you aren’t using the latest version of
react-select
please consider upgrading to see if it resolves any issues you’re having.However, if you feel this issue is still relevant and you’d like us to review it - please leave a comment and we’ll do our best to get back to you!