Skip to content
This repository was archived by the owner on Sep 10, 2023. It is now read-only.

Commit 91551b9

Browse files
committed
Merge pull request #405 from bamarni/patch-2
the id is hardcoded in preventDuplicates section, it should use tokenValue
2 parents 634cf71 + 2ad71db commit 91551b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/jquery.tokeninput.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ $.TokenList = function (input, url_or_data, settings) {
615615
token_list.children().each(function () {
616616
var existing_token = $(this);
617617
var existing_data = $.data(existing_token.get(0), "tokeninput");
618-
if(existing_data && existing_data.id === item.id) {
618+
if(existing_data && existing_data[settings.tokenValue] === item[settings.tokenValue]) {
619619
found_existing_token = existing_token;
620620
return false;
621621
}

0 commit comments

Comments
 (0)