-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Update cleanValue() to allow non-object values(string, number, etc.) #4058
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
base: master
Are you sure you want to change the base?
Conversation
💥 No ChangesetLatest commit: 1598332 Merging this PR will not cause any packages to be released. If these changes should not cause updates to packages in this repo, this is fine 🙂 If these changes should be published to npm, you need to add a changeset. This PR includes no changesetsWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Click here to learn what changesets are, and how to add one. Click here if you're a maintainer who wants to add a changeset to this PR |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 1598332:
|
|
@jimsleon Nice work. The bad news is I don't think the collaborator would accept this change after I checked the early related issues and PR.
|
Probably, but my change is a little bit different, I didn't change any contract of react-select. 🤞 |
|
@JedWatson to review and comment. |
React-select is great and easy to use. I had a simple wrapper around react-select to allow non-object options like string, number, etc. for simple use case so that I don't need to construct object with 'label' & 'value' from simple type by overriding getOptionValue() and getOptionLabel(), but found it doesn't work.(display works fine but can't select a value), it does work for multiple selection. After looked into code I found it is caused by clearValue() which assuming 'option' is object. cleanValue() is only used for processing 'value' property, so please review if this can be merged.