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.templateSelection() is called twice for every selection event #3616
Comments
someone can suggest a workaround for this bug? |
Love this Library, I also ran into this; So in revisiting and looking through the code there is an event called "selection:update"; the listener is registered twice,
Now since its registered in the Base prototype method it should be safe to remove the second binding from the SingleSelection.prototype.bind method. In testing by removing the second binding it will only fire once as you would expect in the ajax case. I am not sure of the Ramifications of doing this though, @kevin-brown would you know if that is the proper fix. |
@smoothlikejazz That should only need to be registered once, and I don't believe the ordering matters. Feel free to submit a pull request which drops it from the SingleSelection. |
Okay great thanks @kevin-brown will do |
@smoothlikejazz Hi! I still have this problem with the Select2 4.0.3. Your PR is not merged? In my case, the BTW, who knows what's the diferrence between "select2.full" and "select2"? Regards!!! |
@kevin-brown There is any date for the 4.1.0 release? There are some workaround for this problem until the new release isnt yet ready? |
I am getting |
+1 here. Experiencing the same problem. |
+1 Firing 8 times. I'll try to preserve this with logical value inverting first time to execute inside UPD: I've removed my
This works for me and do not execute several times. It is happening because |
I'm having the same problem from inside jquery modal/dialog overlay. 2x and 4x times stuff is calling, this makes select2 pretty useless. I'm using latest 4.0.5 .. anyone working to fix this problem? |
It looks like @kevin-brown already gave his blessing for the change made in #4306, so I will add that to the 4.0.6 milestone. |
The fix (#4306) has been merged into |
This is the right way, thank you! |
I am still having this problem with the latest version of select2. any hints on how i can fix this? |
I'm having this issue right now. I'm using: Select2 4.1.0-beta.1 |
Yep.. still seeing it to.. |
Solution of @newmandani is working fine, thanks! |
This can be reproduced with the ajax example given at https://select2.github.io/examples.html and a breakpoint in
formatRepoSelection()
.The text was updated successfully, but these errors were encountered: