-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: allow option value to be set to an object #858
Comments
Weird, I'm doing exactly that (see below) and it works as I would expect it.
For reference, I'm using version |
Hmm I'm on |
unless I want to make the component controlled, it works for me as well. But as soon as I want to pass in values, it doesn't work as expected anymore as the value is compared to the options by |
Hello - In an effort to sustain the 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 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. |
The issue seems not to be solved or is not well documented, please provide explanation how to use objects properly in react-select value? |
Greetings @vasilevich , The implementation for using objects as values seems fairly straight forward. Given this codesandbox example, what other questions or documentation is unclear? I believe this should be marked resolved and closed given:
IF there are other questions and concerns, please feel to object, but I see no reason not to let this rest in peace. |
Hi, There is still an issue with the selected option which doesn't work properly since the verification in isOptionSelected is not done for objects. |
Copy of #572 since there seemed to be a misunderstanding of the core issue there. The desire here is to be able to set options that look like this:
The reason this doesn't work currently is because of how
this.props.value
is interpreted to display the selected option.react-select/src/Select.js
Line 423 in 46ca406
===
is not sufficient for comparing objects:react-select/src/Select.js
Line 427 in 46ca406
Is setting values to objects a feature react-select is interested in supporting? If so, would it be okay to add a dependency on an object deep equality checker like node-deep-equal?
The text was updated successfully, but these errors were encountered: