strange one here. When using React-Select v1.0.0rc (although the bug occurs with all v1.x) using it in Async mode to search an API, sometimes the options will not show in the dropdown menu. There seems to be no reason for why this happens, but it happens with certain search queries and not others.
E.g coconut
works but coconut oil
doesnt, even though both return similar results.
The strange thing is that using the React chrome developer tools I can see that the options are set on the state of the Select, but they just don't appear. Also, if I click off the react-select, then click back on it, the results appear (tested in firefox and chrome). Here is my code and a few screenshots to illustrate
<Select.Async name={ this.generateName('ingredient_id')}
loadOptions={this.getIngredients}
className="admin-meal-ingredient-search-select"
autoload={false}
cache={false}
multi={false}
value={this.props.ingredient}
onChange={this.props.handleIngredientChange}
placeholder="Search for ingredient" />
appearing
I'm using "react-select": "^3.0.4",
and had to add filterOption={false}
prop.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With