Skip to content
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

No input value after select an async option after search #865

Closed
jbmeslin opened this issue Apr 5, 2016 · 6 comments
Closed

No input value after select an async option after search #865

jbmeslin opened this issue Apr 5, 2016 · 6 comments

Comments

@jbmeslin
Copy link

jbmeslin commented Apr 5, 2016

When I select an option after change the inputValue, the selectValue function set the state of the inputValue to an empty string then the loadoptions function is called and my selected option is no more in the options list. so during the renderInput, the function getValueArray return nothing and the place holder is rendered.

Note: After having select one option the renderlabel is called every time on option hover

@amrut-bawane
Copy link

+1

1 similar comment
@xiaolin
Copy link

xiaolin commented Apr 13, 2016

+1

@cirsteve
Copy link

I just figured this out, in async mode with an onChange handler you need to set the value to be the full options object, e.g. {label: 'foo', value: 'bar'}, not just a string value

@jbmeslin
Copy link
Author

I already do that but my value setted by props was the string value. it seems more logical to have options object in both side but i think we should not do this. I think the value should be only the value an not the options.

(Thx)

@steve-taylor
Copy link

Thanks @cirsteve. I had exactly the same problem and your solution worked for me.

@bladey
Copy link
Contributor

bladey commented May 27, 2020

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 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 bladey closed this as completed May 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants