Numeric Values with Multi-Select option not working
See original GitHub issueUnable to get multi select working with options that have integers as values. This would be particularly useful if trying to collect a list of Ids.
-
Visit http://jedwatson.github.io/react-select/ down to
Numeric Values
-
Check
Multi-Select
from the checkboxes -
Select an option from the drop down
You will then see that the select component does not populate
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Laravel Form:select() Multi select options not working if array ...
I want to select multiple options in select, but its only work if Array index key is string, If array index key is...
Read more >Solved: multi select list option input do not display val...
Solved: I´ve been created a flow starting with manually trigger a flow. I set two input text, one numeric an other one as...
Read more >St.multiselect autocomplete/match not working for numerical ...
Hi there, :wave: I was wondering if anyone has tried to enter partial data in the multiselect box and have the options narrowed...
Read more >Kendo Multi Select Option couldn't select multi selected values
Just a quick note, because your problem may indeed be a simple one. It seems like you are mixing numbers with strings. In...
Read more >Recode Values - Qualtrics
Not every question type has the option to recode values. Text Entry questions, for example, are infinitely variable and so cannot have a...
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
The example @pelhage references seems to not be working because of the
simpleValue
attribute being added. In that example, it is not simple values that are being passed in, but rather an array of objects with numeric value properties.I confirmed that with 1.0.0-rc2 multi-select does work with numeric property values, as long as you do not use the
simpleValue
option.It does not seem like passing an array of numbers (rather than an array of objects with number values) works with the
simpleValue
option, so I think that option is broken. You can work around this by mapping the array of numbers to an array of objects withmyArray.map(i => { return { label: i, value: i }; })
Example that works with objects with numeric values (this was scaffolded from create-react-app):
Update: here is an example with using an array of numbers instead of an array of objects, using
map
:Hello -
In an effort to sustain the
react-select
project going forward, we’re cleaning up and 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!