I'm using react-select 2 in my project. Every time a user selects an option, the input value is cleared which causes the option list to change.
Is there any way to retain the input value so the user can select multiple options?
here is what i tried:
<Select
closeMenuOnSelect={false}
blurInputOnSelect={false}
isMulti
loadOptions={this.resultProvider.bind(this)}
inputValue={this.state.searchKey}
onInputChange={this.handleInputChanged.bind(this)}
/>
handleInputChanged(input, reason) {
if (reason.action === "set-value") {
return;
}
this.setState({
...this.state,
searchKey: input
});
}
I have created a demo to demonstrate this issue: https://codesandbox.io/s/345rp0m041
Note that this issue only happend with Async select.
Thanks for advices!