0

I have made a select2 multi input in order to add tags. However, when I click on the input it shows no results found. Is there a better way to remove it instead of adding css?

I use select2 version 4.0.12

https://select2.org/tagging#automatic-tokenization-into-tags

css to remove it:

.select2-results__option.select2-results__message

Initialization:

$(()=>{
    $("#sel-inp").select2({
        tags: true,
        tokenSeparators: [','],
        id: 'add_keywords',
        width: '100%'
    })
})

enter image description here

csandreas1
  • 2,026
  • 1
  • 26
  • 48

1 Answers1

2

Here's the solution using noResults method.

 $("#mail_add_keywords").select2({
    tags: true,
    tokenSeparators: [','],
    id: 'mail_add_keywords',
    width: '100%',
    "language": {
       "noResults": () => "Add Keywords"

    }
})
csandreas1
  • 2,026
  • 1
  • 26
  • 48