No result found doesn't show when loadOptions returns null in Async
See original GitHub issueWhat value to return or function to be invoked when the loadOptions doesn’t return any data. Right now it shows “Type to search”.
Example I got the the function below:
getOptions(input, callback) {
var select2options = {
options: [],
}
Actions.getDevelopers(input,function(err, options){
if (err) {
// throw an error here
}
if (options) {
// loop through
_.forEach(options.data, function(option){
select2options.options.push({
value: option._id,
label: option.name
});
})
select2options.complete = true;
// call the callback
callback(null,select2options);
}
// no result found what to do here to invoke "No result found"?
});
}
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Async not displaying results - Stack Overflow
I want to display "name" values as I type, but on every type it needs to send a new request with getData function....
Read more >API - React Select
A flexible and beautiful Select Input control for ReactJS with multiselect, autocomplete and ajax support.
Read more >Vue-Treeselect
If no options have been initially registered ( options: null ), vue-treeselect will attempt to load root options by calling loadOptions({ action, callback, ......
Read more >react-select-async-paginate | Yarn - Package Manager
null by default. ... It similar to loadOptions from Select.Async but there is some differences: Loaded options as 2nd argument. Additional data as...
Read more >babel/core
In Babel 6, this method was synchronous and transformSync did not exist. ... always returns a result when a file is ignored, rather...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had the same issue. Made it working with explicitly setting
noResultsText
prop. I am returning empty array fromloadOptions
callback when zero results found though, not null. Haven’t tested with null.Hello -
In an effort to sustain the
react-select
project going forward, we’re closing old issues.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 aren’t using the latest version of
react-select
please consider upgrading to see if it resolves any issues you’re having.However, if you feel this issue 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!