Remote search
See original GitHub issueUsing Choices for a while and now I want to implement remote search. The list of users is over 100k, so external load and search is needed.
But it loses focus on every keystroke when typing. Please see jsfiddle example: https://jsfiddle.net/8zn132go/9/
var config = {
'searchResultLimit': 15,
'searchChoices': false
};
var select = document.getElementById('users');
var choice = new window.Choices(select, config);
select.addEventListener('search', function(event) {
if (event.detail.value) {
choice.setChoices(function(callback) {
return fetch(
// below api is only used for this example. it doesn't support query filtering, but its returns some data.
'https://randomuser.me/api/?results=20&q=' + event.detail.value
)
.then(function(response) {
return response.json();
})
.then(function(data) {
return data.results.map(function(user) {
return { value: user.login.uuid, label: user.name.first };
});
});
})
}
});
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:14
Top Results From Across the Web
Search Remotely – A marketplace where current and aspiring ...
Search Remotely. A marketplace where current and aspiring remote workers find new job opportunities and up-skill with online courses. Remote companies can use ......
Read more >Remote Jobs in Today's Popular Categories - Remote.co
Remote.co's job board has openings in the most popular remote job categories. Search for the best opportunities that match your skills & career...
Read more >FlexJobs: Best Remote Jobs, Work from Home Jobs, Online ...
The #1 job site for hand-screened remote jobs (work from home jobs) since 2007. No ads, scams or junk. Discover a better online...
Read more >We Work Remotely: Remote jobs in design, programming ...
Find the most qualified people in the most unexpected places: Hire remote! We Work Remotely is the best place to find and list...
Read more >The 25+ Best Sites For Finding Remote Work Online in 2022
Find the best remote work online with this convenient top 25+ remote job website list. Don't wait to find your dream job, get...
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
This looks like a bug - will look into this 👍
I solved it with simple code below