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

Abort ajax call when the input is less than minimumInputLength #6291

Open
mete89 opened this issue Jan 4, 2024 · 0 comments
Open

Abort ajax call when the input is less than minimumInputLength #6291

mete89 opened this issue Jan 4, 2024 · 0 comments

Comments

@mete89
Copy link

mete89 commented Jan 4, 2024

When using AJAX in combination with minimumInputLength in Select2, the existing request is not being aborted if the number of characters is reduced below the minimumInputLength.

Steps to reproduce:

Go to https://select2.org/data-sources/ajax
Open the first Select2 dropdown.
Enter a character and then immediately delete it.
Initially, you will see the message 'Please enter 1 or more characters', but shortly after, the results from the last AJAX call will appear.

Expected Result:
When the 'minimumInputLength' message is displayed, any ongoing AJAX call should be aborted. Furthermore, if the results from a previously initiated AJAX call are received, they should not override the 'minimumInputLength' warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant