true/false values is not working
<Select value={true} options=[{value: true, label: "Yes"}, {value: false, label: "No"}] />
<Select value={false} options=[{value: true, label: "Yes"}, {value: false, label: "No"}] />
In both cases the option isn't selected. Using string like "true" and "false" make it works.
Isn't allowed to use boolean values?
+1 I've run into this same issue as well. @JedWatson is this something the component should support?
+1
+1, just running into this issue...
Someone ? :octopus:
+1; having same issue.
Is there a plan to support this anytime soon?
I found:
https://github.com/JedWatson/react-select/blob/17d76a4161096cb88fb04a6e9e6529580e67b305/src/Select.js#L564
which essentially restricts values to strings and numbers. If I change that line to:
if (typeof value !== 'string' && typeof value !== 'number' && typeof value !== 'boolean') return value;
...then booleans seem to work fine.
Hello, I am observing this issue again.. value gets selected just fine if value is true. but value is not selected when value is false. const OptionValues = [ {value: true, label: 'Yes'}, {value: false, label: 'No'} ];
I am @^1.0.0-rc.10
forgive me for false alarm.. It was my mistake... i was checking if value is not selected then set default value. and i was doing that by - !value ? defaultValue : value. so whenever value is false it was trying to set it to default value and for that dropdown default value was " ".
onChange={e=> setFavorite(JSON.parse(e.target.value))} return true value