🐛 ModelSelect2MultipleWidget fails to unselect from dropdown #344
-
Bug DescriptionThe ModelSelect2Multiple Widget cannot correctly remove items from the selection by clicking on them in the dropdown. attrs such as data-minimum-input-length make no difference. django-select2 v8.4.1 Steps to Reproduce
Expected BehaviorI expected the item to become unselected. The Select2Multiple works like that, and so does vanilla Select2. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
thanks for reaching out. I took the liberty to move this to a discussion for now, since I have this feature working on my apps. That being said, I'd love to help to get this working. Do you have a demo somewhere, where I could reproduce the issue, or a code snippet? Just a little more to go on? Thanks |
Beta Was this translation helpful? Give feedback.
-
Ah yes, I can reproduce the issue with a select2 multiselect with AJAX, without django-select2. Thank you for your help. |
Beta Was this translation helpful? Give feedback.
Aah, now I get it. Thanks for providing the example, it really helped me to understand the issue. So, this is the behavior of Select2 and is not specific to the Django integration. You'll see the same behavior here: https://select2.org/data-sources/ajax
Deselecting via the search input does not work on AJAX based data sources :/
There isn't really anything I can do, but don't hesitate to open an issue with the Select2 project.
Cheers! Joe