Auto tokenize last item in pasted string using select2
I am using jQuery Select2 to create an input that allows auto tokenization. I've initialized the select2 input with the following options: { tags: [''], tokenSeparators = [',', ' '] } Very basic stuff. When I type a string of text into the input, followed by a comma or space, the preceding string is tokenized, exactly as I would expect. However, I need to support pasting of text into the input. This is where things fall apart. If I paste '1,2,3,4' into the input, I get separate tokens for 1, 2, and 3, but 4 is not tokenized. Instead, it remains as the value of the input.select2-input and when