-
Notifications
You must be signed in to change notification settings - Fork 830
Copy & Paste text thats contains delimiter #22
Comments
A workaround for this would be to capture the Example:var tidyTags = function(e){
var tags = ($(e.target).val() + ',' + e.tags).split(',');
var target = $(e.target);
target.importTags('');
for(var i = 0, z = tags.length; i<z; i++){
var tag = tags[i];
if(!target.tagExist(tag)){
target.addTag(tag);
}
}
}
$('#tags_input').tagsInput({
onAddTag : function(tag){
if(tag.indexOf(',') > 0){
tidyTags({target: '#tags_input', tags : tag});
}
}
}); |
Small improvements to this workaround: 1. correctly handles pasted text with spaces like var tidyTags = function(e) {
var tags = ($(e.target).val() + ',' + e.tags).split(',');
var target = $(e.target);
target.importTags('');
for (var i = 0, z = tags.length; i<z; i++) {
var tag = $.trim(tags[i]);
if (!target.tagExist(tag)) {
target.addTag(tag);
}
}
$('#' + target[0].id + '_tag').trigger('focus');
}; Also, you can call tidyTags with |
Are there any plans on implementing this within jQuery-Tags-Input instead of using this as a work-around? |
Are there any plans to implement this natively instead of having to use this as a work-around? |
Implementing this workaround as one of my user wanted to copy/paste large amount of tags (delimited by a space). +1 for earthmeLon request. |
Text is not parsed when somebody paste text that contains delimiter (for example "foo, bar, test").
The text was updated successfully, but these errors were encountered: