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
[multiselect] Disable showing dropdown when select2-selection__choice__remove is clicked #3209
Comments
For me quick fix/workaround/patch was stopping event propagation for click event in select2/selection/multiple.js file:
Please verify if it's acceptable solution, as I see no downside to this. |
Select2 sends the original jQuery Event with the http://jsbin.com/qiweciveve/1/edit?html,js,output $("select").on("select2:unselect", function (evt) {
if (!evt.params.originalEvent) {
return;
}
evt.params.originalEvent.stopPropagation();
}); |
Thanks, this is IMHO optimal way to handle this. |
it doesn't work with xeditable select2.
|
Going from @kevin-brown 's solution, this will prevent the dropdown from showing in all cases when removing a multiselect item, even if you prevent the removal. Note the use of
I found this approach preferable (simpler) in my case - i.e. preventing the dropdown can be done in the |
@kevin-brown This is not working when multiple select2 elements are present on page. Is there a reason for this behavior? |
Hello All,
Thanks for the great component. We have managed to get very close with our implementation but we are struggling with one last detail.
When the user removes a multiselect item the dropdown menu is shown. Is there a way to disable the behavior ?
Thanks in advanced.
Greg
The text was updated successfully, but these errors were encountered: