react-select icon indicating copy to clipboard operation
react-select copied to clipboard

valueKey / labelKey do not work as expected.

Open pkuzhel opened this issue 8 years ago • 6 comments

Hi.

I have the same issue as https://github.com/JedWatson/react-select/issues/1807 (which is closed). I have an array of currencies: const currencies = [{ code: "USD", name: "American Dollar", symbol: "$"}, ...]

and for my value and label keys I specify valueKey="code". But react-select craps out and won't render properly. Only works if my object has the value prop.

Thanks!

pkuzhel avatar Dec 20 '17 21:12 pkuzhel

Hi @pkuzhel I don't see the problem and can't reproduce . Try to add also labelKey='name' and use latest react-select version.

yuri-sakharov avatar Dec 22 '17 01:12 yuri-sakharov

I am also having this issue. labelKey works as expected; valueKey does not. Upgrading to the latest version of react-select (1.2.1) did not resolve the issue.

My select components work if I add a value property to the options, even when valueKey has a value other than "value". It seems like react-select is ignoring the value of valueKey.

tamias avatar Jan 16 '18 16:01 tamias

It looks like it only works if you set simpleValue={true}. But if you have multiselection enabled, the simpleValues get concatenated to a string instead of an array.

chillyistkult avatar Jan 23 '18 11:01 chillyistkult

same issue

kenzouno1 avatar Jun 12 '18 06:06 kenzouno1

I also got issue with labelKey and valueKey. They don't work in v2.0.0 Beta Currently, i get back to v1 to make it work

farizsofyan avatar Jun 12 '18 07:06 farizsofyan

Hello -

In an effort to sustain the react-select project going forward, we're closing old issues / pull requests.

We understand this might be inconvenient but in the best interest of supporting the broader community we have to direct our limited efforts to maintain the latest 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 / pull request 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!

bladey avatar May 27 '20 07:05 bladey