Ajax-Bootstrap-Select
Ajax-Bootstrap-Select copied to clipboard
behaviour on close / reopen
I'm using a multiple select and find it odd that after closing / reopening the widget the previously typed text disappears from the search input, whereas the items which matched that search are still available in the list below it. Is there any option to make it more consistent?
I am having this same issue.
It looks like clearOnEmpty
is not being obeyed for some reason.
I did the following to replicate clearing the items,
$('select').selectpicker('deselectAll');
$('select').find('[value]').remove();
$('select').selectpicker('refresh');
Our issues are different. I was only mentioning the lookup results under the divider line, not being removed after closing/re-opening the widget
Anyway... 4 years later, I finally spent some time on this problem and solved it this way:
$('#VariantIds button.dropdown-toggle').on('click', function() {
if ($('#VariantIds ul li.selected').length == 0)
$('#VariantIds ul li').remove();
else
$('#VariantIds ul li:gt(0):not(.selected)').remove();
});
(VariantIds is just a div wrapping the selectpicker)