tag-it
tag-it copied to clipboard
Pasting Text not interpreted correctly
When you paste tags into the box such as Music, Musical-Instrument it is interpreted as one tag. Pasted text should be checked for commas to allow multiple tags to be pasted at once.
@Ecroyd Same as issue: #139
Here's a solution that ties into the paste event. I put the code in around line 224, right before the keydown bind.
this.tagInput.bind('paste', function (event) {
// Set short timeout so .val() will have a value
setTimeout(function () {
var tagArray = that.tagInput.val().split(/[\n,]+/);
if (tagArray.length > 1) {
for (var i = 0; i < tagArray.length; i++) {
that.createTag(tagArray[i]);
}
}
}, 100);
});