loopj/jquery-tokeninput — Issue #254: changing tokenValue breaks preventDuplicates
Author: nextavenue
Created: 2012-01-22 20:30:51+00:00
State: open

I used the tokenValue parameter, but it seems to break the preventDuplicates. Despite setting the tokenValue to "key", preventDuplicates matches a duplicate on the default hardcoded "id" property of an item.

```javascript
// line: 534
if(existing_data && existing_data.id === item.id) {
```

should be changed to:

```javascript
if(existing_data && existing_data[settings.tokenValue] === item[settings.tokenValue]) {
```