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

Ajax is requested when clear button is pressed and dropdown has been kept closed #6116

Open
kxtzzz opened this issue Nov 5, 2021 · 3 comments

Comments

@kxtzzz
Copy link

kxtzzz commented Nov 5, 2021

When you click on the clear all button on a Ajax enabled select2 (either single or multiple), the action fires a request to the ajax source. This is in the scenario where the dropdown is forcibly kept closed by the code given in the issue below.

I have found 1 other mention of this in Prevent select2:open when clearing selection#3320 where @kevin-brown comments on a post by @nafetsrybak with the same issue and suggests he creates a bug - however I cannot find if a bug was raised or not.
I have tested this in 4.0.13 and here is the jsbin
I did not know how to do a mockdata ajax request in jsbin but by using a url of "" still allows the problem to be highlighted. The select initially gets loaded with the options data, then on pressing clear button you can see in the Network tab of the developer tools, a request is sent even though the dropdown remains closed.

@stale
Copy link

stale bot commented Mar 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the status: stale label Mar 2, 2022
@kxtzzz
Copy link
Author

kxtzzz commented Mar 2, 2022

Bump to stop the stalebot.

@stale stale bot removed the status: stale label Mar 2, 2022
@stale
Copy link

stale bot commented May 1, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the status: stale label May 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants