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

Commit 32f2f35

Browse files
author
Georg Schmidl
committed
Don't add tokens if limit has been reached.
1 parent 3c115b1 commit 32f2f35

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/jquery.tokeninput.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,10 @@ $.TokenList = function (input, url_or_data, settings) {
470470
}
471471

472472
// Insert the new tokens
473-
insert_token(item);
474-
checkTokenLimit();
473+
if(settings.tokenLimit == null || token_count < settings.tokenLimit) {
474+
insert_token(item);
475+
checkTokenLimit();
476+
}
475477

476478
// Clear input box
477479
input_box.val("");

0 commit comments

Comments
 (0)