betaWeb / inputTags-jQuery-plugin

http://betaweb.github.io/inputTags-jQuery-plugin/
40 stars 19 forks source link

Comma should be replaced with period or Dash in order to avoid conflicts with Google Autocomplete & Other plugins #6

Closed ravaljigesh closed 8 years ago

ravaljigesh commented 8 years ago

Hello,

Effort was : To integrate with Google AutoComplete

Problem: Google AutoComplete Supply data in Comma Separated Value so every location becomes tag (I.E. Ahmedabad, Gujarat, India => So tags are Ahmedabad and Gujarat and India)

Solution: I had to change Google Supplied comma separated data to convert into DASH or PERIOD

Code Change: line 225 to 227 var value = self.$input.val().trim(); myvalue = value.replace(/,/g, ' - ', value); var value = myvalue;

line 200, 201 myvalue = value.replace(/,/g, ' - ', value); var value = myvalue;

line 347 to 349 myvalue = value.replace(/,/g, ' - ', value); var $content = $(self.ITEM_CONTENT.replace('%s', myvalue)); var $item = $('<span>').addClass(self.ITEM_CLASS + ' is-closed').attr('data-tag', myvalue).html($content);

This is not an issue but solution for someone searching same.

Thanks for your great work!

betaWeb commented 8 years ago

Hello,

Thanks for the trick ! :)