-
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
Is there a way to set the inputValue via props when using asyncOptions #392
Comments
When the react-select component is fed a value prop on initial render (consider a parent component's getInitialState feeding in an empty string), and then a call to some backend service is launched and changes the value in the parent state to be an option object - the asyncOptions function is fired off despite the fact that options have not been requested. Traced the issue to componentWillReceiveProps(). When the props change on react-select, it should probably only fire asyncOptions if the autoload prop is true. Opened a PR to address #477 |
Have the similar problem. I have a grid with lots of react-select components. And they all simultaneously call |
Version 1 of react-select is no longer supported. In the best interest of the community we've decided to spend the time we have available on the latest version. We apologise for any inconvenience. Please see: |
My scenario is that I fetch options from web service, label and value.
I then select the options, handle the change and keep value in store.
The value of the select is being set via the value property, which when it changes to the value (id) to replaces the value of the input, then triggers another async call to find values using the value in the input (which is now the id).
Is there a way of setting the value and inputValue so the inputValue doesn't get changed to the ID and trigger call to ayncOptions? I don't want to do a fetch against the remote item, when I already have the value and label in the store.
Thanks
The text was updated successfully, but these errors were encountered: