-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Description
Hi there, I was wondering there is a way to "debounce" async option loading with react-select. Currently, I'm seeing queries like this:
I would like react-select to only query after a 250ms typing pause. What do I need to do to make react-select do this? I have tried wrapping my function in a setTimeout, but that does not appear to do anything:
taxons (input, callback) {
setTimeout(function () {
$.ajax({
url: '/api/v2/taxons/search',
dataType: 'json',
cache: false,
data: { name: input },
success: function (response) {
var options = response.data.map(function(taxon, index) {
return (
{ value: taxon.id, label: taxon.attributes.tree_name }
);
});
callback(null, {
options: options
})
}
})
}, 250)
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
