hailwood/jQuery-Tagit — pull request #28 by gabe (2012-02-03 22:00:00+00:00)
Title: Removing a tag always internally removes the last tag, regardless of which was clicked

_popTag always removes the last tag, as it uses $.inArray to search this.tagsArray for the index of the tag to remove. The problem is that it is searching by tag label, while the elements of tagsArray are objects in the form { label: '', value: '' }. So $.inArray never matches, which defaults _popTag to removing the last element. Then, when getting tags using .tagit('tags'), the tags returned may not match what is shown by the UI.

This change updates the code used to search tagsArray for the tag to be removed.