mdbootstrap/bootstrap-templates

There should be an option to ignore the case of tags.

hemal2cool opened this issue · 1 comments

At present, it is possible to add the same tag if it has a different case i.e. it is possible to add the tags "Cairo" and "cAiro", which is the same.

Using tagsinput js, we are facing the above issue. There should be an option to ignore the case of tags, turning it "true" won't allow the tags having the same value but different case.

Regards,
Hemal PAtel

You can temporarily try adding to your code. It is not native but it will work:

$('input').on("beforeItemAdd", function(e){ 
   var name = e.item; 
   var allow = true;
   $(this).prev().find(".tag").each(function(i, valor){
       if ($(this).text().toLowerCase() == name.toString().toLowerCase()){
           allow = false;
           return false;
       }
   })

   if (!allow){
       console.log("repeat");
       e.cancel = true;
   }
});