anand patil
anand patil

Reputation: 497

Select2.js with multiple tags and not dropdown icon?

In Select2.js, by default there is a select dropdown box and a dropdown icon to make it intuitive for the user that it is a dropdown and not just an input box.

When we make the select dropdown box with multiple tags enabled, the dropdown box looks more like an input text box. basically the dropdown icon is missing.

Please refer - https://select2.github.io/examples.html

So to add the dropdown icon, i could add it in the select2.js file. But i think it is not a good idea. Any other easier or better way to get the dropdown icon for multi - select select2 js dropdown box?

Upvotes: 0

Views: 1357

Answers (1)

Praveen Kumar Purushothaman
Praveen Kumar Purushothaman

Reputation: 167182

As the documentation says, when you are using tags, it will become an input box. Select is only for single selection, and Textbox is for multiple selection, a.k.a. tags. :) This is by design.

The best alternate is to use placeholders, which can tell the users that it is a multiselect autosuggest:

$(element).select2({
  placeholder: "Start typing..."
});

Upvotes: 1

Related Questions