Reputation: 1162
I am using react-select. I do not want to remove selected items from the options list. It looks like it removes selected options from the options list automatically when you add isMulti, because when I do not have isMulti, it is not removing selected option. I have seen that I can use a prop called filterOption, but I did not understand how to make it work. Can anyone tell me how to use filterOption to show all options even if some options are selected? And if Select removes the selected options automatically, does anyone have a suggestion on how I can display all the options even if some option are selected?
import Select from 'react-select';
...
<Select
value={this.value()}
isDisabled={this.props.disabled}
closeMenuOnSelect={false}
components={Animated}
isMulti
isClearable
onChange={this.props.onChange}
onBlur={this.onBlur}
options={this.props.options}
/>
BTW: I can see that there are an option to uncheck "Remove selected options" inside the DEMO, but I can not get to the source, it returns 404. Here is the link to the demo I am looking at, under the title "Multiselect": https://jedwatson.github.io/react-select/
Upvotes: 4
Views: 9172