tag-it icon indicating copy to clipboard operation
tag-it copied to clipboard

Pasting Text not interpreted correctly

Open EffectivelyEfficient opened this issue 10 years ago • 1 comments

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.

EffectivelyEfficient avatar Jan 22 '15 00:01 EffectivelyEfficient

@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);
            });

jgimness avatar Mar 30 '16 14:03 jgimness