select2-multi-checkboxes icon indicating copy to clipboard operation
select2-multi-checkboxes copied to clipboard

Can it be made typeahead instead of dropdown?

Open Diparati opened this issue 7 years ago • 4 comments

Similar to the previous select2 multiple, can this multiple checkboxes be made typeahead too?

What I mean is the user types for the value, gets it, checks it, clicks outside, the label shows "1 selected". If instead of clicking outside, he backspaces and types another, gets it, checks it, clicks outside, the label shows "2 selected". Something like this.

So if you refer, https://jsfiddle.net/wasikuss/7ak9skbb/, I guess I am asking if the 2nd and 3rd select box functionalities can be combined?

Diparati avatar Jan 28 '19 10:01 Diparati

+1

jamezrgomez avatar Aug 01 '19 08:08 jamezrgomez

add minimumResultsForSearch: 0 then you can search for items. https://select2.org/searching#limiting-display-of-the-search-box-to-large-result-sets - for meaning of this option.

https://jsfiddle.net/04mar3z9/ - here you can check how it works

wasikuss avatar Sep 22 '19 20:09 wasikuss

well, using that selection does not work, at least for me :)

evlo avatar Nov 25 '19 11:11 evlo

well, using that selection does not work, at least for me :)

If you place minimumResultsForSearch before templateSelection it works as expected.

$('.select2-multiple2').select2MultiCheckboxes({
    minimumResultsForSearch: 0,
    templateSelection: function(selected, total) {
      return "Selected " + selected.length + " of " + total;
    }
});

nickl- avatar Jul 20 '21 21:07 nickl-