Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Remove delay before displaying results #734

Open
pereorga opened this issue Jun 18, 2024 · 5 comments
Open

[Bug]: Remove delay before displaying results #734

pereorga opened this issue Jun 18, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@pereorga
Copy link

pereorga commented Jun 18, 2024

Bug description

When answering a question about tom-select performance in Stack Overflow, I noticed there is a delay when searching. When not loading the data from a remote resource, results start appearing half a second later, no matter how many options the element has.

Expected behavior

Ideally, results should display immediately after key press. In other solutions (Selectize.js, typeahead.js, etc.) results appear immediately

Steps to reproduce

  1. Go to https://tom-select.js.org/
  2. Click on the example
  3. Press "b"
  4. See results appear after a short delay, maybe 0.5 seconds

Additional context

  • OS: All
  • Browser: All
  • Version: latest
  • Device: All
@pereorga pereorga added the bug Something isn't working label Jun 18, 2024
@nbelakovski-mssm
Copy link

I've also noticed this. I notice that selectize.js doesn't have this issue and there appears to be some minimal activity in that repo, even if it's mostly documentation related, so I decided to go with that one.

@pereorga
Copy link
Author

pereorga commented Jul 7, 2024

This is not documented, AFAICS, but this can be addressed setting refreshThrottle option to 0:

  refreshThrottle: 0,

Found it in the code:

refreshThrottle: 300,

@nbelakovski-mssm
Copy link

Nice find @pereorga! Can confirm it works in a codepen. One of us should make a PR to at least add this to the documentation, and maybe also default it to 0.

@pereorga
Copy link
Author

pereorga commented Jul 7, 2024

One of us should make a PR to at least add this to the documentation, and maybe also default it to 0.

I would be happy to do it if there was a chance it can get merged (unfortunately, the project seems a bit unmaintained at this moment). Meanwhile, people can find the solution here.

@kristofer84
Copy link

This is not documented, AFAICS, but this can be addressed setting refreshThrottle option to 0:

  refreshThrottle: 0,

Found it in the code:

refreshThrottle: 300,

Good find!
For me I also had to change loadThrottle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants